Want a special badge and 30 bux? Make some PolyWorld! Content and post it in the Creations forum!
Dark mode is incomplete! Please report any issues to the Discord.

Players

Scripts Not creatable

Players is the service for listing who is in the place and configuring place-wide player settings.
Available as the global Players.


Overview

Properties

Methods

Events


API

Properties

ResetEnabled

ResetEnabled : bool
When true (default), the pause-menu Respawn action works.
Set to false to ignore character reset for this place.

Players.ResetEnabled = false
Methods

GetPlayers

GetPlayers() : List of Players
Returns every player currently in the place.

for _, player in ipairs(Players:GetPlayers()) do
    print(player.Id, player.Name)
end

Also callable as Players.GetPlayers() without colon syntax.

GetLocalPlayer

GetLocalPlayer() : Player
LocalScripts only. Returns the local client player — the same object as the global player.

local me = Players:GetLocalPlayer()
print(me.Name, me.Id)

Also callable as Players.GetLocalPlayer() without colon syntax. Not available in server Scripts.

Events

PlayerAdded

PlayerAdded : Event (player: Player)
Triggers when a player finishes joining the place.

Players.PlayerAdded:Connect(function(player)
    player:Notify("Welcome!")
end)

Defining function PlayerAdded(player) in a Script body is still supported.
Prefer Connect instead.
No longer recommended for use.

PlayerRemoving

PlayerRemoving : Event (player: Player)
Triggers when a player is about to leave the place.

PlayerDied

PlayerDied : Event (player: Player)
Triggers when a player's health hits 0.

Players.PlayerDied:Connect(function(player)
    Chat:Broadcast(player.Name .. " died")
end)

Defining function PlayerDied(player) in a Script body is still supported.
Prefer Connect instead.
No longer recommended for use.