Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

script won't work even if value == true?

Asked by
mehssi 20
9 years ago

SORRY FOR THE LONG SCRIPT! everything works except the if game.Workspace.bgk.Value == true then line, anyone know why? i need this to only work if the value is true, please help me

001local debris = game:service("Debris")
002bin = script.Parent
003Go = 0
004 
005Kick = false
006function onKeyDown(key)
007if game.Workspace.bgk.Value == true then
008if Go.Value == 1 then return end
009if key ~= nil then
010key = key:lower()
011if key == "e" then
012Go = 1
013if script.Parent.Parent.Parent.Character == nil then return end
014if script.Parent.Parent.Parent.Character:findFirstChild("Torso") == nil then return end
015if script.Parent.Parent.Parent.Character:findFirstChild("Right Arm") == nil then return end
View all 117 lines...
0
output 1waffle1 2908 — 9y

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

If you actually formatted the code, you would be able to see that onSelected is only defined inside of the onKeyDown function when it is called, so line 117 cannot access it.

Ad

Answer this question