So, I discovered that you could do something like this:
game.Players.LocalPlayer.Character.Humanoid.Died:wait()
So, does that basically wait until the character dies?
So, I discovered that you could do something like this:
game.Players.LocalPlayer.Character.Humanoid.Died:wait()
So, does that basically wait until the character dies?
Yes, using :Wait() after an event instead of :Connect() will wait for the event to fire.
--// Example
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Wait()
print(plr.Name.." Died!")
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Okay, awesome! Thanks, I really needed to know that worked for sure.
And returns any arguments that event give ;)