| |
|
»
»
|
|
| |
continues to print "failed"
|
|
|
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
|
  |
| Joined: 30 Jan 2012 |
| Total Posts: 176 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|
|
| |
|
|
| |
|
»
»
|
|
|
|
|