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)