Does anyone know how to have a function run when a player respawns?
The CharacterAdded function. This triggers every time a Character is added. The event can be called from the Player model.
game.Players.LocalPlayer.CharacterAdded:Connect(function() -stuff- end)
or from a server script, as your localscript can reset too when the character respawns:
game.Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(c) --stuff end) end)