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

How can I change the PlayerAdded event for when a player respawns?

Asked by 10 years ago

The Title is explaining, I sometimes see that the PlayerAdded event only works when a Player joins, but doesn't when a Player resets, how can I change it so that I can use the PlayerAdded function but like a GUI or Tool gets added back into the Player's PlayerGui or Backpack on reset?

1 answer

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

What you are looking for is the CharacterAdded event. Here is a bit of sample code for you:

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        -- What you want to happen when the player respawns.
    end)
end)
1
Oh, the CharacterAdded event does that? o_e I didn't know that, thanks for showing me this, its going to become very helpful! :) +1 TheeDeathCaster 2368 — 10y
0
No problem man! BlackJPI 2658 — 10y
Ad

Answer this question