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

How do I make player not able to jump?

Asked by 10 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)

I have been using this script and you are still able to jump. Could anyone fix this so no players will be able to jump?

1 answer

Log in to vote
1
Answered by 10 years ago

Try this:

1game.Players.PlayerAdded:connect(function(plr)
2plr.CharacterAdded:connect(function(char)
3local Human = char:FindFirstChild("Humanoid", true)
4Human.Changed:connect(function()
5Human.Jump = false
6end)
7end)
8end)
0
It worked. Thank you! Tonitrua 20 — 10y
0
Please don't just post code, explain what you're doing. Perci1 4988 — 10y
0
Nothing much to explain, it's pretty straightforward. ultimate055 150 — 10y
Ad

Answer this question