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 9 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?

1repeat wait() until plr.Character
2 
3local chr = plr.Character
4 
5chr:WaitForChild("Humanoid").Changed:connect(function()
6    chr.Humanoid.Jump = false
7end)

1 answer

Log in to vote
3
Answered by 9 years ago

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

01repeat wait() until plr.Character
02local chr = plr.Character
03 
04local event = chr:WaitForChild("Humanoid").Changed:connect(function()
05    chr.Humanoid.Jump = false
06end)
07 
08wait(12)
09 
10event:disconnect()
Ad

Answer this question