Scripts and integrations
Exports for your scripts
Your server scripts can talk to SafeGuard through exports (server side only; players cannot call them).
-- Before teleporting a player (garages, houses, jail, events): avoids false "teleport".
exports.safeguard:allowTeleport(source, 5000) -- milliseconds
-- Sequences with cameras and special flags (cutscenes, character creation, admin tools).
exports.safeguard:grace(source, 30000)
-- Payouts: SafeGuard refuses amounts above the limit and while quarantined.
local ok = exports.safeguard:economyTransaction(source, 'bank', 5000, 'job:trucker')
if ok then xPlayer.addAccountMoney('bank', 5000) end
-- Read the player's state.
local quarantined = exports.safeguard:isQuarantined(source)
local risk = exports.safeguard:getRisk(source) -- { global = 12.5, level = 'normal' }
-- One of your scripts noticed something suspicious (never treated as server proof).
exports.safeguard:reportDetection(source, 'economy.money_spike', 0.7, { amount = 1000000 })Discord alerts
In Integrations → Discord alerts add the webhook of a staff channel and pick the events: critical threats, bans, high-risk players, servers offline, license expiring, critical scanner findings, staff actions and new ban appeals. Without the cloud, set the webhook in server.cfg:
set safeguard_discord_webhook "https://discord.com/api/webhooks/…"
API keys
In Integrations → API keys you create keys with limited permissions, for your own tools or the Discord bot. The key is shown once; revoke it if it leaks.
Resource scanner and Discord bot
The scanner checks your resources folder for backdoors, obfuscated code, exposed webhooks and unprotected events, and uploads only the findings (never your code) to the Scanner page. The Discord bot brings /player, /ban, /unban, /server, /detections and /screenshot to your staff.