Permissions & Moderation SDK Reference
Complete reference for all read and write functions in RoPerms.lua related to permissions, bans, kicks, and punishments.
ℹRequire first
RoPerms.Init() once at startup before using any function.Permissions — read#
RoPerms.GetPerm(playerOrId: Player | number, permKey: string): boolean
Returns true if the player currently holds the named permission.
if RoPerms.GetPerm(player, "vip") then
-- grant VIP benefits
endRoPerms.GetPermAttr(playerOrId: Player | number, permKey: string, attrKey: string): any
Returns the value of a single attribute on the player's permission assignment, or nil if the permission is not held or the attribute is not set.
local tier = RoPerms.GetPermAttr(player, "whitelist", "tier")
-- tier might be "bronze", "silver", or "gold"RoPerms.GetPermAttrs(playerOrId: Player | number, permKey: string): table | nil
Returns a key-value table of all attributes for the named permission, or nil if the permission is not held.
local attrs = RoPerms.GetPermAttrs(player, "vip")
if attrs then
print(attrs.color, attrs.tier)
endRoPerms.GetPerms(playerOrId: Player | number): table
Returns a list of all permission keys the player currently holds.
local perms = RoPerms.GetPerms(player)
for _, key in ipairs(perms) do
print(key)
endRoPerms.IsBanned(playerOrId: Player | number): boolean, string | nil
Returns whether the player is currently banned. If banned, also returns the ban reason as a second value.
local banned, reason = RoPerms.IsBanned(player)
if banned then
player:Kick("You are banned: " .. reason)
endRoPerms.IsToolbanned(playerOrId): boolean
Returns true if the player has an active tool ban. RoPermsClient.lua applies the CoreGui change automatically — use this function if you need to check the state manually in a server script.
RoPerms.IsChatbanned(playerOrId): boolean
Returns true if the player has an active chat ban.
RoPerms.IsModcallBanned(playerOrId): boolean
Returns true if the player is banned from submitting modcalls.
RoPerms.GetWarnings(playerOrId): number
Returns the total number of warnings issued to the player.
RoPerms.Invalidate(playerOrId: Player | number)
Clears the local cache for a player. The next call to any read function will fetch fresh data from the backend. Useful after granting/revoking permissions outside the SDK (e.g., via the dashboard).
-- After granting a perm from the dashboard, force the cache to refresh
RoPerms.Invalidate(player)Permissions — write#
RoPerms.GrantPerm(playerOrId: Player | number, permKey: string): boolean
Grants the named permission to the player. Returns true on success.
local ok = RoPerms.GrantPerm(player, "vip")
if not ok then warn("Failed to grant VIP") endRoPerms.RevokePerm(playerOrId: Player | number, permKey: string): boolean
Removes the named permission from the player. Returns true on success.
RoPerms.CreatePerm(key: string, displayName: string, color: string): boolean
Creates a new permission definition for the org. color is a hex string (e.g., '#8b5cf6'). Returns true if created, false if the key already exists.
RoPerms.DeletePerm(key: string): boolean
Deletes a permission definition and all its assignments. This is permanent — use carefully.
RoPerms.ListPerms(): table
Returns an array of all permission definitions for the org. Each entry has key, displayName, and color fields.
Moderation — write#
RoPerms.Ban(playerOrId: Player | number, reason: string, durationDays: number?): boolean
Creates a ban record for the player. Omit durationDays or pass nil for a permanent ban. Returns true on success. If enforcement is enabled, the player is kicked from the server automatically.
-- Permanent ban
RoPerms.Ban(player, "Exploiting")
-- 7-day ban
RoPerms.Ban(player, "Harassment", 7)RoPerms.Unban(playerOrId: Player | number): boolean
Lifts the player's active ban. Returns true on success.
RoPerms.Kick(playerOrId: Player | number, reason: string): boolean
Kicks the player from all active servers without creating a ban record. Returns true if the kick was queued successfully.
RoPerms.Warn(playerOrId: Player | number, reason: string): boolean
Issues a warning to the player. Warnings are recorded on the player's profile and counted.
RoPerms.Toolban(playerOrId: Player | number, reason: string, durationDays: number?): boolean
Applies a tool ban. If RoPermsClient.lua is installed, the Backpack CoreGui is hidden for the player. Permanent if durationDays is omitted.
RoPerms.Chatban(playerOrId: Player | number, reason: string, durationDays: number?): boolean
Applies a chat ban. If RoPermsClient.lua is installed, the Chat CoreGui is hidden. Works with both the legacy chat and TextChatService.
RoPerms.Modcallban(playerOrId: Player | number, reason: string, durationDays: number?): boolean
Prevents the player from submitting modcalls. The SDK rejects their modcall.create requests while the ban is active.
Caching behaviour#
All read functions cache results per-player for cacheDuration seconds (default 60). This means:
- The first read for a player fires an HTTP request to the backend.
- Subsequent reads within the window return the cached value instantly.
- Write functions automatically invalidate the cache for the affected player.
- Call
RoPerms.Invalidate(player)to force a fresh fetch after an out-of-band change.