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

How can I disabled the jump for the Player's Character?

I am trying trying to Disable the Jump for the character, but I am not totally sure how I can, so I tried doing this;

plr=game:service("Players").LocalPlayer
repeat wait(0)until plr.Character~=nil
function oc()
plr.Character:FindFirstChild("Humanoid").Jump=false
end
plr.Character.Jumping:connect(oc)

Did I do it correctly or does it not work?

2 answers

✓ Accepted answer
function OnEntered(Player)
    while Player.Character == nil do
        wait()
    end
end
function OnRespawned(Character)
    local Torso = Character:findFirstChild("Torso")
    if Torso ~= nil then
        local AntiJump = Instance.new("BodyPosition")
        AntiJump.Parent = Torso
        AntiJump.position = Vector3.new (0,6,0)
        AntiJump.maxForce = Vector3.new (0,10000000000,0)
    end
end
game.Players.ChildAdded:connect(OnEntered)
game.Workspace.ChildAdded:connect(OnRespawned)

2 comments

0

Thanks man! Thanks very much! ;)

0

A Vote up would be nice :D!

OR just put this in a LocalScript inside the PlayerGui

return wait() until game.Players.LocalPlayer.Character.Humanoid
game.Players.LocalPlayers.Character.Humanoid.Changed:connect(function()
	game.Players.LocalPlayers.Character.Humanoid.Jump = false
end)

Much simpler.

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