while true do wait(0.1) if game.Players.LocalPlayer.leaderstats.Stop.Value == 1 then RunService:BindToRenderStep('Control', Enum.RenderPriority.Input.Value, onUpdate) ContextActionService:BindAction('Left', onLeft, true, 'a', Enum.KeyCode.Left, Enum.KeyCode.DPadLeft) ContextActionService:BindAction('Right', onRight, true, 'd', Enum.KeyCode.Right, Enum.KeyCode.DPadRight) ContextActionService:BindAction('Jump', onJump, true, 'w', Enum.KeyCode.Space, Enum.KeyCode.Up, Enum.KeyCode.DPadUp, Enum.KeyCode.ButtonA) end if game.Players.LocalPlayer.leaderstats.Stop.Value == 0 then print("SSSSSS") RunService:BindToRenderStep('Control', Enum.RenderPriority.Input.Value, onUpdate) ContextActionService:BindAction('Left', onLeft, false, 'a', Enum.KeyCode.Left, Enum.KeyCode.DPadLeft) ContextActionService:BindAction('Right', onRight, false, 'd', Enum.KeyCode.Right, Enum.KeyCode.DPadRight) ContextActionService:BindAction('Jump', onJump, false, 'w', Enum.KeyCode.Space, Enum.KeyCode.Up, Enum.KeyCode.DPadUp, Enum.KeyCode.ButtonA) end end
So, this script it's supposed to not allow player movement if a leaderstat called "stop" == 0. It's a snippet of a larger script, but this is all that really matters.
Yes, it does register whenever the value is changed i checked.
Can someone tell me what i did wrong here?
PS ( Yes hiimgoodpack, I indented specifically so you wouldn't put me on your kill list.)
Disable Player.PlayerScripts.ControlScript using a LocalScript already inside it.