Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a function when a character respawns?

I have a promblem in my game and need to call a function (or however you say) when a character respawns. If there is a way, then you, who give me an answer, can just print something when a character respawns. Then I can change what happens myself, I just want to learn how to make the function. Thank you!

1 answer

✓ Accepted answer

Use the Player.CharacterAdded signal, which is fired every time the Player's character spawns. The character model is passed to any listeners:

local playersService = game:GetService("Players")

playersService.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(print)
end)

2 comments

0

"Use the Player.CharacterAdded signal" ? This is called an event.

0

It is an RBXScriptSignal, not an event >:(

This discussion is preserved as it was. New answers, comments, and votes are closed.