Engine Server API Reference

Core API

Comprehensive API reference for Engine.luau public methods, exemptions, hits, and transactions.

# Overview

The Engine singleton (ServerScriptService/RAC/Core/Engine.luau) serves as the primary gateway for integrating RAC into custom game mechanics, weapons, and shops.

To consume the API in your server scripts:

local RAC = require(game.ServerScriptService.RAC.Core.Engine)

# Method Index

# State & Telemetry

# Engine:GetPlayerState(player: Player): Types.PlayerMonitoringState?

Returns the active monitoring record for a connected player, including ping, airtime, and risk score.

# Engine:GetRiskScore(player: Player): number

Returns the normalized risk score ($0 \dots 150$) for the specified player.

# Engine:GetPlayerIncidents(player: Player): { Types.DetectionIncident }

Returns the complete list of violation incidents recorded for the player in the current session.

# Engine:GetUptime(): number

Returns the elapsed runtime in seconds since the RAC server engine initialized.


# Movement Exemptions

# Engine:AddExemption(player: Player, reason: string, durationSeconds: number)

Temporarily exempts a player from movement detectors. Use this when applying server-driven velocity boosts, dashes, knockback effects, or cutscene teleports.

-- Dash skill example
local function OnPlayerDash(player: Player)
    -- Grant a 1.5-second movement exemption for the dash
    RAC:AddExemption(player, "DashSkill", 1.5)
    
    -- Apply velocity impulse
    local rootPart = player.Character.HumanoidRootPart
    rootPart.AssemblyLinearVelocity = rootPart.CFrame.LookVector * 120
end

# Engine:RemoveExemption(player: Player, reason: string?)

Revokes an active exemption immediately. If reason is omitted, all active exemptions for the player are cleared.


# Combat & Economy Validation

# Engine:ValidateHit(attacker: Player, targetCharacter: Model, claimedDamage: number, weaponType: string?): (boolean, number)

Validates that an attack respects reach boundaries, attack cooldowns, line-of-sight geometry, and damage caps.

  • Returns: (isValid: boolean, approvedDamage: number). If invalid, isValid is false and approvedDamage is 0.
local isValid, approvedDamage = RAC:ValidateHit(attacker, victimChar, 75, "Rifle")
if isValid then
    victimHumanoid:TakeDamage(approvedDamage)
end

# Engine:ValidateTransaction(player: Player, amount: number, transactionType: string): boolean

Validates that an economy purchase or trade satisfies transaction frequency limits and value caps.


# Disciplinary Enforcement

# Engine:WarnPlayer(player: Player, reason: string, issuerName: string?)

Sends an in-game warning dialogue to the specified player.

# Engine:KickPlayer(player: Player, reason: string, issuerName: string?)

Disconnects the player from the current server instance.

# Engine:BanPlayer(userId: number, username: string, reason: string, durationSeconds: number?, issuerName: string?)

Bans the player account across all game servers. If durationSeconds is omitted or nil, the ban is permanent.

# Engine:UnbanPlayer(userId: number, issuerName: string?)

Lifts an active ban and broadcasts the revocation across all servers via MessagingService.


# Next Steps