generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

continues to print "failed"

Previous Thread :: Next Thread 
Hective is not online. Hective
Joined: 30 Jan 2012
Total Posts: 176
10 Dec 2016 02:30 PM
local Keys = {[Enum.KeyCode.Z]=true,[Enum.KeyCode.X]=true,[Enum.KeyCode.C]=true,[Enum.KeyCode.V]=true,[Enum.KeyCode.B]=true,[Enum.KeyCode.N]=true,[Enum.KeyCode.M]=true,}

UIS.InputBegan:connect(function(Key,GPE)
if Keys[Key.KeyCode] and not GPE and Stats.Mode.Value == "Weapon" and Stats.Permanent.Race.Value == "Magician" then
print("passed")
if CommandOne == "" and MainGui.Frame.Magician.Spell1.Position == UDim2.new(0, 0, .95, 0) then
CommandOne = Key.KeyCode
print("Combination" .. CommandOne)
MainGui.Frame.Magician.Spell1:TweenPosition(UDim2.new(0, 0, .9, 0), "Out", "Back", 1)
elseif CommandOne ~= "" and CommandTwo == "" and MainGui.Frame.Magician.Spell2.Position == UDim2.new(.25, 0, .95, 0) then
CommandTwo = Key.KeyCode
print("Combination" .. CommandTwo)
MainGui.Frame.Magician.Spell2:TweenPosition(UDim2.new(.25, 0, .9, 0), "Out", "Back", 1)
elseif CommandTwo ~= "" and CommandThree == "" and MainGui.Frame.Magician.Spell3.Position == UDim2.new(.5, 0, .95, 0) then
CommandThree = Key.KeyCode
print("Combination" .. CommandThree)
MainGui.Frame.Magician.Spell3:TweenPosition(UDim2.new(.5, 0, .9, 0), "Out", "Back", 1)
elseif CommandThree ~= "" and CommandFour == "" and MainGui.Frame.Magician.Spell3.Position == UDim2.new(.75, 0, .95, 0) then
CommandFour = Key.KeyCode
print("Combination" .. CommandFour)
MainGui.Frame.Magician.Spell4:TweenPosition(UDim2.new(.75, 0, .9, 0), "Out", "Back", 1)
end
else
print("failed")
end
end)

It still continues to print failed.

Stats.Race.Value is equal to Magician
Stats.Mode.Value is equal to Weapon

Could it be the keys? If so what would I need to do to fix it?
Report Abuse
Hective is not online. Hective
Joined: 30 Jan 2012
Total Posts: 176
10 Dec 2016 03:25 PM
b1
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
10 Dec 2016 03:27 PM
Its because you need to make sure the values are true. Debug with prints


Report Abuse
Hective is not online. Hective
Joined: 30 Jan 2012
Total Posts: 176
10 Dec 2016 03:46 PM
I debugged it and now it's saying:
16:44:35.477 - Players.Player1.Backpack.Client:590: bad argument #3 to 'Value' (string expected, got EnumItem)

Code:
UIS.InputBegan:connect(function(Key,GPE)
if Keys[Key.KeyCode] and not GPE then print("passed")
if Stats.Mode.Value == "Weapon" then print("passed2")
if Stats.Permanent.Race.Value == "Magician" then print("passed3")
local keyPressed = Key.KeyCode
if Stats.CommandOne.Value == "" and MainGui.Frame.Magician.Spell1.Position == UDim2.new(0, 0, .95, 0) then
Stats.CommandOne.Value = keyPressed
print("Combination " .. Stats.CommandOne.Value)
MainGui.Frame.Magician.Spell1:TweenPosition(UDim2.new(0, 0, .9, 0), "Out", "Back", 1)
elseif Stats.CommandOne.Value ~= "" and Stats.CommandTwo.Value == "" and MainGui.Frame.Magician.Spell2.Position == UDim2.new(.25, 0, .95, 0) then
Stats.CommandTwo.Value = keyPressed
print("Combination " .. Stats.CommandTwo.Value)
MainGui.Frame.Magician.Spell2:TweenPosition(UDim2.new(.25, 0, .9, 0), "Out", "Back", 1)
elseif Stats.CommandTwo.Value ~= "" and Stats.CommandThree.Value == "" and MainGui.Frame.Magician.Spell3.Position == UDim2.new(.5, 0, .95, 0) then
Stats.CommandThree.Value = keyPressed
print("Combination " .. Stats.CommandThree.Value)
MainGui.Frame.Magician.Spell3:TweenPosition(UDim2.new(.5, 0, .9, 0), "Out", "Back", 1)
elseif Stats.CommandThree.Value ~= "" and Stats.CommandFour.Value == "" and MainGui.Frame.Magician.Spell3.Position == UDim2.new(.75, 0, .95, 0) then
Stats.CommandFour.Value = keyPressed
print("Combination " .. Stats.CommandFour.Value)
MainGui.Frame.Magician.Spell4:TweenPosition(UDim2.new(.75, 0, .9, 0), "Out", "Back", 1)
end
end
end
else
print("failed")
end
end)
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
10 Dec 2016 03:49 PM
Well whatever is on line 590 needs to be a string not an enum

key.Keycode.Name is probably best here


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image