In-game API
Build your own report buttons, report windows and anti-cheat checks in Roblox on top of Modhelm Reports and Modhelm Guard. Objects, examples and limits, without HttpService.
6 min read
Modhelm Reports and Modhelm Guard work as soon as they are in your game: a Report button for players, a staff panel for your team. If your game has its own menus, you can build on them instead: your own Report button, your own report window, your own anti-cheat checks and your own button for the staff panel.
Everything runs inside Roblox with BindableEvents and BindableFunctions that the Modhelm scripts create when the server starts. Nothing of it needs HttpService, so Allow HTTP Requests can stay off. You get the scripts from the Downloads page.
Where everything lives
| Object | Type | Runs on | Use it from |
|---|---|---|---|
ServerStorage.ModhelmReports.Report | BindableFunction | Server | A Script |
ServerStorage.ModhelmReports.Reported | BindableEvent | Server | A Script |
ServerStorage.ModhelmReports.Categories | BindableFunction | Server | A Script |
PlayerGui.ModhelmReports.Open | BindableEvent | Client of every player | A LocalScript |
ServerStorage.ModhelmGuard.Exempt | BindableEvent | Server | A Script |
ServerStorage.ModhelmGuard.CheckHit | BindableFunction | Server | A Script |
ServerStorage.ModhelmGuard.Flag | BindableEvent | Server | A Script |
PlayerGui.ModhelmGuard.Open | BindableEvent | Client of staff only | A LocalScript |
Players cannot see or fire anything in ServerStorage, so exploit tools cannot reach the server objects. The two Open events only open a window on that player's screen. Every report and every panel action is checked on the server again.
The objects appear a moment after the server or the player starts, so look them up with WaitForChild.
Modhelm Reports
Your own Report button
Open the Report window from any button of yours, for example in a player list or on a name tag. Pass a user id to pick that player right away, or leave it out to let the player choose. This goes into a LocalScript:
local Players = game:GetService("Players")
local gui = Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("ModhelmReports")
local open = gui:WaitForChild("Open")
reportButton.Activated:Connect(function()
open:Fire(otherPlayer.UserId) -- or open:Fire() for the player list
end)The user id must belong to a player in this server or one who left it in the last 10 minutes.
Hide the default button
At the top of the LocalScript ModhelmReportsClient (inside the Script ModhelmReports) set:
local SHOW_BUTTON = falseThe Report button is gone, the window still opens through Open. The Modhelm Reports plugin keeps this setting when it updates the scripts.
Your own report window
If your game has its own report window, set GIVE_UI = false at the top of the Script ModhelmReports. Players then get no Modhelm window at all, and you send reports from the server. Report answers true once the report is in the queue and false when a check or a limit stopped it:
-- Script in ServerScriptService. MyReportRemote is the RemoteEvent of your own window.
local ServerStorage = game:GetService("ServerStorage")
local report = ServerStorage:WaitForChild("ModhelmReports"):WaitForChild("Report")
MyReportRemote.OnServerEvent:Connect(function(player, targetUserId, category, text)
local sent = report:Invoke(player, targetUserId, category, text)
MyReportRemote:FireClient(player, sent)
end)Report takes the reporting player, the user id of the reported player, a category and an optional text. It runs the same checks and limits as the Modhelm window: the reported player is in the server or left it in the last 10 minutes, nobody reports themselves, the text has at most 500 characters, one report per player a minute and five an hour, the same player once an hour per reporter. An unknown category becomes other.
React to reports: Reported
Reported fires after every report that went into the queue, from the Modhelm window and from Report. It passes the reporting player, the user id of the reported player and the category:
local reported = ServerStorage:WaitForChild("ModhelmReports"):WaitForChild("Reported")
reported.Event:Connect(function(reporter, targetUserId, category)
print(reporter.Name .. " reported " .. targetUserId .. " for " .. category)
end)Use it to thank the player, to give a quest a tick or to log reports in your own system. Your listener cannot stop or change a report.
The same reasons: Categories
Categories returns the category ids in the order players see them, and a label for each id. Use it so your own window shows the same reasons as Modhelm:
local categories = ServerStorage:WaitForChild("ModhelmReports"):WaitForChild("Categories")
local ids, labels = categories:Invoke()
for _, id in ids do
print(id, labels[id]) -- for example: exploiting Cheating or exploiting
endother is always there and always last. The list is read again every 5 minutes. To show it on the client, send it through your own RemoteFunction.
Modhelm Guard
Moving players: Exempt
When your server code moves a player (teleport pads, PivotTo, vehicles without seats), this looks like a teleport to the checks. Exempt the player for a few seconds first:
local guard = ServerStorage:WaitForChild("ModhelmGuard")
local exempt = guard:WaitForChild("Exempt")
exempt:Fire(player, 3) -- seconds, at most 3600
character:PivotTo(spawnPoint.CFrame)During the exemption the movement checks, remote spam, prompts, clicks and reach are skipped for that player. Your own flags still count.
Reach for your weapons: CheckHit
If your weapons decide hits on the server, ask before you deal damage. CheckHit answers false and records a reach hit when the attacker stands too far from the victim:
local checkHit = guard:WaitForChild("CheckHit")
if checkHit:Invoke(attackerPlayer, victimPlayerOrModel, 12) then
humanoid:TakeDamage(20)
endThe third value is the range of the weapon in studs. Modhelm Guard adds a little room for lag on top, depending on the sensitivity.
Your own checks: Flag
Your game knows things the anti-cheat cannot: what an item costs, how much damage a sword deals, which areas a player has seen. When your server code sees something only a cheater can do, flag it:
local flag = guard:WaitForChild("Flag")
if price > coins then
flag:Fire(player, "Bought an item without enough coins", price)
return
endA flag counts like a hit of the built-in checks: it shows on the dashboard and in Discord alerts, can save a replay, appears in the staff panel as "Own check: " followed by your label, and counts toward the kick when the action is set to kick.
| Value | Rule |
|---|---|
| Player | A player in this server |
| Label | Text your team reads, at most 50 characters, control characters are removed |
| Value | Optional number, for example the price or the damage |
| Limits | At most 20 flags per player in 10 seconds are taken, and one hit per player about every second counts |
You can turn your own checks off in the Modhelm Guard settings of the game, like every other check.
Your own button for the staff panel
The staff panel is a ScreenGui named ModhelmGuard that only staff get. Its Open event opens or closes the panel like the F2 key. Fire(true) only opens it, Fire(false) only closes it. In a LocalScript:
local playerGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
adminMenuButton.Activated:Connect(function()
local panel = playerGui:FindFirstChild("ModhelmGuard") -- missing for players who are not staff
local open = panel and panel:FindFirstChild("Open")
if open then
open:Fire()
end
end)Show your button only to staff, for example while playerGui:FindFirstChild("ModhelmGuard") is there. The panel can arrive a few seconds after joining, when the settings are loaded.
To hide the Modhelm button at the bottom left, set local SHOW_BUTTON = false at the top of the LocalScript ModhelmGuardPanel (inside the Script ModhelmGuard). F2 and Open still work.
Good practice
- Call the server objects only from Scripts on the server. A LocalScript cannot reach ServerStorage.
- Treat everything that comes from a player's RemoteEvent as untrusted. Check it in your handler before you pass it on; Modhelm checks it again.
- Use
WaitForChildfor the objects, they are made when the Modhelm scripts start. - Keep the setting lines at the top of the scripts as they are, only change the value.