Identity
who a player is, and whether the account is an admin
Fields
3 members
- displayName:
string player display name
- isAdmin:
boolean whether the user has administrative privileges
- userId:
number unique numeric user identifier
Checking Whether a Player Is an Admin
Lifecycle: Server
Only a character bound to a player has an identity; every other instance returns nil.
Luau
game.Session.PlayerJoined:Connect(function(userId: number) local character = game.Session.CharacterOf(userId) if not character then return end local identity = character:GetIdentity() if identity and identity.isAdmin then print("Admin joined:", identity.displayName) endend)