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
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)

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:

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
local Human = char:FindFirstChild("Humanoid", true)
Human.Changed:connect(function()
Human.Jump = false
end)
end)
end)

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