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

How do you create a script that disables jump?

Asked by 10 years ago

I am having trouble figuring it out

3 answers

Log in to vote
-1
Answered by
NotSoNorm 777 Moderation Voter
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)
Ad
Log in to vote
1
Answered by
trogyssy 221 Moderation Voter
10 years ago

I think it would go something like this:

Game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function() p.Character.Humanoid.Changed:connect(function(property) 
if property~="Jump" then return end
p.Character.PlatformStand=true
wait(0)
p.Character.PlatformStand=false
end) end) end)
Log in to vote
1
Answered by 10 years ago

I actually asked this question before, and it's much simpler than it seems. This would be in a LocalScript. My original question is here.

player = game.Players.LocalPlayer
char = player.Character
hum = char:findFirstChild("Humanoid")
hum.Changed:connect(function()
    hum.Jump = false
end)

Answer this question