Skip to main content

Role.Has

Shared
boolean Lyn.Player.Role.Has(Player target, string|table role)Function

Description

Returns whether the specified player has the given role(s). Supports string, array-style, and dictionary-style table inputs.

Params

  1. Player target
  2. string | table role

Returns

  1. Whether the player has the role (or any of the roles if table provided).

Example:

-- Single role
if Lyn.Player.Role.Has(Entity(1), "admin") then
print("Player has admin role.")
end

-- Multiple roles (any match)
if Lyn.Player.Role.Has(Entity(1), {"admin", "moderator", superadmin = true}) then
print("Player has at least one of the roles.")
end