script won't work even if value == true?
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
001 | local debris = game:service( "Debris" ) |
006 | function onKeyDown(key) |
007 | if game.Workspace.bgk.Value = = true then |
008 | if Go.Value = = 1 then return end |
013 | if script.Parent.Parent.Parent.Character = = nil then return end |
014 | if script.Parent.Parent.Parent.Character:findFirstChild( "Torso" ) = = nil then return end |
015 | if script.Parent.Parent.Parent.Character:findFirstChild( "Right Arm" ) = = nil then return end |
016 | if script.Parent.Parent.Parent.Character:findFirstChild( "Left Arm" ) = = nil then return end |
017 | if script.Parent.Parent.Parent.Character:findFirstChild( "Right Leg" ) = = nil then return end |
018 | if script.Parent.Parent.Parent.Character:findFirstChild( "Left Leg" ) = = nil then return end |
019 | Torso = script.Parent.Parent.Parent.Character.Torso |
020 | RA = script.Parent.Parent.Parent.Character [ "Right Arm" ] |
021 | LA = script.Parent.Parent.Parent.Character [ "Left Arm" ] |
022 | RL = script.Parent.Parent.Parent.Character [ "Right Leg" ] |
023 | LL = script.Parent.Parent.Parent.Character [ "Left Leg" ] |
024 | Hip = Torso [ "Right Shoulder" ] |
026 | Hip 1 = Torso [ "Left Shoulder" ] |
028 | HipL = Torso [ "Right Hip" ] |
030 | HipL 1 = Torso [ "Left Hip" ] |
032 | W = Instance.new( "Weld" ) |
036 | Y = Instance.new( "Weld" ) |
040 | U = Instance.new( "Weld" ) |
044 | T = Instance.new( "Weld" ) |
049 | script.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 17 |
050 | script.Parent.Parent.Parent.Character.Torso.Friction = "1" |
051 | script.Parent.Parent.Parent.Character [ "Left Arm" ] .Friction = "2" |
052 | script.Parent.Parent.Parent.Character [ "Right Arm" ] .Friction = "2" |
053 | script.Parent.Parent.Parent.Character [ "Left Leg" ] .Friction = "1" |
054 | script.Parent.Parent.Parent.Character [ "Right Leg" ] .Friction = "1" |
055 | W.C 0 = CFrame.new( 1.8 , 0.3 , 0.1 ) * CFrame.fromEulerAnglesXYZ(math.pi/ 6 ,- 0.5 , 1 ) |
056 | Y.C 0 = CFrame.new(- 1.8 , 0.3 , 0.1 ) * CFrame.fromEulerAnglesXYZ(math.pi/ 6 , 0.5 ,- 1 ) |
057 | U.C 0 = CFrame.new( 0.9 ,- 1.7 ,- 0.3 ) * CFrame.fromEulerAnglesXYZ(math.pi/ 8 ,- 0.2 , 0.3 ) |
058 | T.C 0 = CFrame.new(- 0.9 ,- 1.7 ,- 0.3 ) * CFrame.fromEulerAnglesXYZ(math.pi/ 8 , 0.2 ,- 0.3 ) |
059 | RL.Touched:connect( function (hit) |
060 | if Kick = = false then return end |
061 | if hit.Locked = = true or hit.Anchored = = true then return end |
063 | A = Instance.new( "BodyVelocity" ) |
065 | A.velocity = RL.CFrame.lookVector * 70 |
066 | A.maxForce = Vector 3. new( 4 e+ 006 , 1 e+ 003 , 4 e+ 006 ) |
069 | LL.Touched:connect( function (hit) |
070 | if Kick = = false then return end |
071 | if hit.Locked = = true or hit.Anchored = = true then return end |
073 | B = Instance.new( "BodyVelocity" ) |
075 | B.velocity = LL.CFrame.lookVector * 70 |
076 | B.maxForce = Vector 3. new( 4 e+ 006 , 1 e+ 003 , 4 e+ 006 ) |
079 | Torso.Touched:connect( function (hit) |
080 | if Kick = = false then return end |
081 | if hit.Locked = = true or hit.Anchored = = true then return end |
083 | N = Instance.new( "BodyVelocity" ) |
085 | N.velocity = Torso.CFrame.lookVector * 70 |
086 | N.maxForce = Vector 3. new( 4 e+ 006 , 1 e+ 003 , 4 e+ 006 ) |
090 | W.C 0 = CFrame.new( 1.8 , 1 , 0.1 ) * CFrame.fromEulerAnglesXYZ(-math.pi, 0 , 1 ) |
091 | Y.C 0 = CFrame.new(- 1.8 , 1 , 0.1 ) * CFrame.fromEulerAnglesXYZ(-math.pi, 0 ,- 1 ) |
092 | U.C 0 = CFrame.new( 1.2 ,- 1.7 ,- 0.3 ) * CFrame.fromEulerAnglesXYZ(math.pi/ 4 ,- 0.5 , 0.7 ) |
093 | T.C 0 = CFrame.new(- 1.2 ,- 1.7 ,- 0.3 ) * CFrame.fromEulerAnglesXYZ(math.pi/ 4 , 0.5 ,- 0.7 ) |
110 | bin.Deselected:connect( function () |
112 | function onSelected(mouse) |
113 | mouse.KeyDown:connect(onKeyDown) |
117 | bin.Selected:connect(onSelected) |