Collapse Sidebar


The PlayerAdded event fires when a player enters the game. This is used to fire an event when a player joins a game, such as loading the player’s saved GlobalDataStore data.

This can be used alongside the Players/PlayerRemoving event, which fires when a player is about to leave the game. For instance, if you would like print a message every time a new player joins or leaves the game:

local Players = game:GetService("Players")

	print(player.Name .. " joined the game!")

	print(player.Name .. " left the game!")

If you want to track when a player’s character is added or removed from the game, such as when a player respawns or dies, you can use the Player/CharacterAdded and Player/CharacterRemoving functions.


  • Up until recently, this event didn’t work on the client (in Localscripts), but this has been changed

  • This event does not work as expected in solo mode, because the player is created before scripts that connect to PlayerAdded run. To handle this case, as well as cases in which the script is added into the game after a player enters, create an OnPlayerAdded function that you can call to handle a player’s entrance.


Name Type Default Description

An instance of the player that joined the game.

Code Samples


This example will print "A player has entered: " followed by the name of the player that enters/joins a game every time a player joins.

	print("A player has entered: " .. player.Name)