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

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

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

Log in to vote
0
Answered by
Rurith 10
10 years ago
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)

0
Thanks man! Thanks very much! ;) TheeDeathCaster 2368 — 10y
0
A Vote up would be nice :D! Rurith 10 — 10y
Ad
Log in to vote
0
Answered by
hudzell 238 Moderation Voter
10 years ago

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.

Answer this question