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

Disabling jump and wait 12 seconds then you can jump?

Asked by 8 years ago

Hi i was trying to make ti so that the humanoids jump is disabled for 12 seconds then you can jump again please help?

 repeat wait() until plr.Character

local chr = plr.Character

chr:WaitForChild("Humanoid").Changed:connect(function()
    chr.Humanoid.Jump = false
end)

1 answer

Log in to vote
3
Answered by 8 years ago

Make the event a variable, and disconnect it after the given amount of time. Try studying this example:

 repeat wait() until plr.Character
local chr = plr.Character

local event = chr:WaitForChild("Humanoid").Changed:connect(function()
    chr.Humanoid.Jump = false
end)

wait(12)

event:disconnect()

Ad

Answer this question