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

How do you disable jumping?

Asked by 10 years ago

I know that it can be done, but I am not sure how. I tried using BodyForce, but that doesn't work. Any suggestions?

4 answers

Log in to vote
2
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

Remember that the Jump property of Humanoid is what tells the character to jump, it does not signify that the character is currently jumping. This means that once the Jump property is set to true, the character will jump.

Despite this, the following code will still work because it sets jump to false so fast after it's set to true, Roblox doesn't even notice it. However, It only works in a local script.

local plr = game.Players.LocalPlayer
    repeat wait() until plr.Character
local chr = plr.Character

chr:WaitForChild("Humanoid").Changed:connect(function()
    chr.Humanoid.Jump = false
end)
0
Perfect! Thanks a lot! User#348 0 — 10y
0
I just realized that using this, you can rebind the space key really easily by just adding code! :D User#348 0 — 10y
0
Rebind? The space key will always remain functional, this just deletes the message it sends before Roblox can read it. Perci1 4988 — 10y
0
I mean you can make the space key do other things. However this doesn't work in servers, which is a problem... User#348 0 — 10y
0
You can make the space key do other things, just use KeyDown or KeyUp events. Perci1 4988 — 10y
Ad
Log in to vote
3
Answered by 8 years ago

In the player's humanoid there's a Property called "JumpPower." Set it to 0 via Script and that's it!

Copy this as a Script in ServerScriptService, Workspace, Etc:

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").JumpPower = 0
    end)
end)
Log in to vote
0
Answered by
Tkdriverx 514 Moderation Voter
10 years ago

Just setting Jump to false as soon as it's changed to true does NOT work in server scenarios. They only work in the Play Solo, so this means you need to do some networking or something (with RemoteEvents, etc.) to get it to work properly.

0
huh, your right. User#348 0 — 10y
0
Or use a local script hudzell 238 — 10y
0
Using a local script will not work in a server if you want it to be secure from hackers. Meaning, "FilteringEnabled" being set to true. Tkdriverx 514 — 10y
Log in to vote
-3
Answered by 10 years ago

Remove their legs and tell them you'll be removing their heads next if they not comply!

0
You do realize that doesn't work... User#348 0 — 10y
0
LOL movsb 242 — 7y
0
Best, IDEA IN THE UNIVERSE! AIphanium 124 — 6y
0
xD isaacjh100 41 — 4y
0
yes! XxOPGUYxX1234567 221 — 4y

Answer this question