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

How do I detect if a player respawns (If they die, I need to detect when they respawn)?

Asked by 10 years ago

I managed to create a script that changes a player's walkspeed when they join the game, but how would I make it work when they respawn?

function changeSpeed(player)
    repeat
        wait()
    until player.Character ~= nil
    game.Players:GetPlayerFromCharacter(player)
    player.Character.Humanoid.WalkSpeed = 9.5
end

game.Players.PlayerAdded:connect(changeSpeed)

1 answer

Log in to vote
0
Answered by 10 years ago

Figured it out myself, didn't know Died() even existed.

Ad

Answer this question