Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Disabling space key?

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:

Instance.new("HumanoidController", game:GetService("ControllerService")):UnbindButton(32)

2 comments

0

Thank you so much!

0

No problem @RepeatLua

1 answer

✓ Accepted answer

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!

--local script, inside of StarterPack
local Plr = game.Players.LocalPlayer 
repeat wait() until Plr.Character -- make sure the Player's character exists
local Hum = Plr.Character:WaitForChild("Humanoid") -- Lets get the Humanoid; wait until it exists

Hum.JumpPower = 0

2 comments

0

would be a lot more efficient just to use characteradded in a server script, because this is not fe-compatible

0

Yes, this is FE compatible. Characters get replicated.

This discussion is preserved as it was. New answers, comments, and votes are closed.