Meet the Player object — the account behind the name — and the two facts about it that matter most.
Everything you've built so far has treated "the player" as a name on a leaderboard. Time to meet the actual person: the Player object — the account-level object that owns a name, a UserId, and leaderstats.
A Player is the account-level object: their name, their UserId, their leaderstats. Two facts matter most:
local Players = game:GetService("Players")
-- everyone currently connected
local everyone = Players:GetPlayers()
-- fire when a new person joins
Players.PlayerAdded:Connect(function(player)
print(player.Name .. " joined with ID " .. player.UserId)
end)
Players:GetPlayers() answers "who is here right now". PlayerAdded answers "someone just arrived". Together they cover everyone in your game.
What does Players:GetPlayers() return?
The Player is the account; the character is the 3D body standing on your baseplate. They're separate objects, and the character can change — every time a player dies and respawns, an old character is removed and a new one is created.
The player persists across the whole session — account, stats, identity. The character is a temporary body, thrown away on death. "Respawn" is simply "make a new body" without touching the account. This distinction is everywhere in Roblox code.
The Player is the ; the character is the temporary
Because they're separate, you code for them differently:
player.character.Get it backwards and your code breaks: setting health on the player does nothing (players don't have health — characters do), and saving the character does nothing (characters get destroyed).
When a player joins, print a greeting that includes their name. Write the connect line for PlayerAdded.
local Players = game:GetService("Players")
-- greet each new player
Next: the body — characters and Humanoids.