GetPlayerSerial
Jump to navigation
Jump to search
getPlayerSerial
Returns the stable server-side serial assigned to a connected player.
Syntax
string|false getPlayerSerial(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
Returns
Returns the player's serial string, or false when the player is invalid or no serial is available.
Examples
Associate persistent data with a player serial:
local serial = getPlayerSerial(playerId)
if serial then
outputDebugString("Connected serial: " .. serial)
end
Notes
- Available only in server-side resource scripts.
- Treat the serial as an account or moderation identifier, not as a secret.
- Authorization decisions must remain server-side.