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

How do i make it so something happens like a function for when people respawn?

Asked by 3 years ago

Like if people either die from a sword or respawn

1 answer

Log in to vote
0
Answered by
Soban06 410 Moderation Voter
3 years ago

You need to use the CharacterAdded event . You use it like this:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        -- This code will fire when player respawns...
    end)
end)

For more reference, you can see this:

https://developer.roblox.com/en-us/api-reference/event/Player/CharacterAdded

Hope it helped

Ad

Answer this question