Modcalls & Enforcement
Enable the in-game modcall command so players can request moderator help, and turn on enforcement so bans and kicks issued from the dashboard take effect automatically in live servers.
Enforcement#
Enforcement means the SDK automatically kicks any player who is banned when they join, and delivers pending kicks to players who are in-game when a kick is issued from the dashboard.
RoPerms.EnableEnforcement()
Starts enforcement. Call this once at server startup. Automatically hooks PlayerAdded to check bans on join, and starts the kick-poll loop to deliver pending kicks.
local RoPerms = require(game.ServerScriptService.RoPerms)
RoPerms.Init()
RoPerms.EnableEnforcement()How enforcement works
- On join — when a player joins,
IsBanned()is called. If the result is true, the player is immediately kicked with the ban reason. - Kick poll — every
kickPollIntervalseconds (default 5), the server callskick.ackto check for and deliver any pending kicks that were issued from the dashboard while the player was already in-game. - Acknowledgement — once a kick is delivered, the SDK sends a confirmation to the backend so the kick is not re-delivered.
RoPerms.DisableEnforcement()
Stops enforcement. Disconnects the PlayerAdded hook and stops the kick-poll loop. Rarely needed — use this only if you need to temporarily suspend enforcement.
Modcall command#
The modcall command lets players type a command in chat to submit a moderation request. This request appears in the dashboard queue instantly.
RoPerms.EnableModcallCommand(opts: table?)
Wires up the modcall command. Registers both a TextChatCommand (for TextChatService, Roblox's default since 2023) and a legacy Player.Chatted listener.
RoPerms.EnableModcallCommand({
-- The command prefix. Default: "/modcall"
command = "/modcall",
-- Message shown to the player after submission
confirmMessage = "Your modcall has been submitted. A moderator will assist you shortly.",
})ℹTextChatService vs legacy chat
Player.Chatted does not fire under TextChatService. EnableModcallCommand() registers both a TextChatCommand (for new games) and a Chatted handler (for games that explicitly use the legacy chat), so both setups work automatically.Manual modcall submission
If you prefer a custom UI (e.g., a dedicated button) instead of a chat command, call RoPerms.Modcall(player, reason) directly from a server Script:
-- Example: submit a modcall when a player clicks a UI button
-- (RemoteEvent fired from client → server handler)
submitModcallEvent.OnServerEvent:Connect(function(player, reason)
local success = RoPerms.Modcall(player, reason)
if success then
-- Notify the player
end
end)RoPerms.Modcall(player: Player, reason: string): boolean
Submits a modcall for the player with the given reason. Returns false if the player is modcall-banned. This is the function used internally by EnableModcallCommand.
Server heartbeat#
The server heartbeat keeps the Live Serverspanel in the dashboard up to date. It reports the server's job ID, player count, and performance metrics periodically.
RoPerms.EnableServerHeartbeat(opts: table?)
Starts sending periodic heartbeat pings to the backend. The Live Servers panel shows all reporting servers. Also reports server close when the instance shuts down.
RoPerms.EnableServerHeartbeat({
-- Interval in seconds between heartbeats. Default: 30
interval = 30,
})Combining features#
A typical server script setup for a moderation-focused game:
local RoPerms = require(game.ServerScriptService.RoPerms)
RoPerms.Init()
-- Core moderation
RoPerms.EnableEnforcement()
RoPerms.EnableModcallCommand({
command = "/mod",
confirmMessage = "Staff have been notified.",
})
-- Live server panel
RoPerms.EnableServerHeartbeat()
-- Activity data
RoPerms.EnableActivityTracking()
RoPerms.EnableChatlogs()
print("[RoPerms] Ready")