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 11 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;

1plr=game:service("Players").LocalPlayer
2repeat wait(0)until plr.Character~=nil
3function oc()
4plr.Character:FindFirstChild("Humanoid").Jump=false
5end
6plr.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
11 years ago
01function OnEntered(Player)
02    while Player.Character == nil do
03        wait()
04    end
05end
06function OnRespawned(Character)
07    local Torso = Character:findFirstChild("Torso")
08    if Torso ~= nil then
09        local AntiJump = Instance.new("BodyPosition")
10        AntiJump.Parent = Torso
11        AntiJump.position = Vector3.new (0,6,0)
12        AntiJump.maxForce = Vector3.new (0,10000000000,0)
13    end
14end
15game.Players.ChildAdded:connect(OnEntered)
16game.Workspace.ChildAdded:connect(OnRespawned)
0
Thanks man! Thanks very much! ;) TheeDeathCaster 2368 — 11y
0
A Vote up would be nice :D! Rurith 10 — 11y
Ad
Log in to vote
0
Answered by
hudzell 238 Moderation Voter
11 years ago

OR just put this in a LocalScript inside the PlayerGui

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

Much simpler.

Answer this question