I can't figure out how to disable the space key. I need this because I'm making a racing game where I don't want players to jump out of the cars. Why isn't this working, and what can I do to make it work?
This is what I've tried:
1 | Instance.new( "HumanoidController" , game:GetService( "ControllerService" )):UnbindButton( 32 ) |
This is a great way to use ROBLOX's new update on JumpPower for Humanoids! I've tested this and it appears to work!
This line of code would be a basic Idea, but it would remove the ability of jumping forever, so if you ever want them to jump, you must make some adjustments!
1 | --local script, inside of StarterPack |
2 | local Plr = game.Players.LocalPlayer |
3 | repeat wait() until Plr.Character -- make sure the Player's character exists |
4 | local Hum = Plr.Character:WaitForChild( "Humanoid" ) -- Lets get the Humanoid; wait until it exists |
5 |
6 | Hum.JumpPower = 0 |