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

Disabling space key?

Asked by 8 years ago

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)
0
Thank you so much! RepeatLua 90 — 8y
0
No problem @RepeatLua alphawolvess 1784 — 8y

1 answer

Log in to vote
4
Answered by 8 years ago

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
0
would be a lot more efficient just to use characteradded in a server script, because this is not fe-compatible unmiss 337 — 8y
0
Yes, this is FE compatible. Characters get replicated. RepeatLua 90 — 8y
Ad

Answer this question