{"id":"thelightsaberthatisblue-cell/fairguard","name":"fairguard","scope":"thelightsaberthatisblue-cell","platform":"roblox","description":"A server-only Roblox anticheat. Framework-first: everything that moves a player goes through its API, so it always knows why.","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"fe0dfe92f0489a3d677623cc49742e383943b27ba05da0b0f0dabaa0c1ad1631","likes":0,"downloads":0,"install":"forest install thelightsaberthatisblue-cell/fairguard","url":"https://forest.dev/p/roblox/thelightsaberthatisblue-cell/fairguard","files":"https://api.forest.dev/ai/package/roblox/thelightsaberthatisblue-cell/fairguard/files","readme":"# FairGuard\n\nA free, open-source, server-only anticheat for Roblox. It is a framework, not a\ndrop-in: anything that can change where a player is or how fast they move goes\nthrough FairGuard's API, which mirrors the Roblox APIs. That way the server\nalways knows the *cause* of every physical change, and anything it can't\nexplain is a violation.\n\n## Install\n\nPut it in **ServerScriptService** (a Wally server package under\n`ServerPackages` is fine if that folder is inside ServerScriptService). Do not\nput it in ServerStorage: Scripts never run there, so it can't start.\n\nThere is no `Start` call and it can't be turned off from the client. It boots\nitself when installed.\n\n```lua\nlocal FairGuard = require(path.to.FairGuard)\n```\n\n## What it creates\n\nOne `RemoteEvent` named `FairGuard` in ReplicatedStorage, made at runtime. It\nis the only door from client to server. The client fires it as\n\n```lua\nremote:FireServer(\"ActionName\", ...)\nremote.OnClientEvent:Connect(function(actionName, ...) end)\n```\n\nThe client holds nothing valuable; assume it can always be tampered with.\n\n## Use the API instead of the Roblox calls\n\n| Roblox | FairGuard |\n| --- | --- |\n| `character:PivotTo(cf)` | `FG:PivotTo(character, cf)` |\n| `character:TranslateBy(v)` | `FG:TranslateBy(character, v)` |\n| `humanoid.WalkSpeed = n` | `FG:SetWalkSpeed(character, n, { Duration = 3 })` |\n| `humanoid.JumpHeight = n` | `FG:SetJumpHeight(character, n, { Duration = 3 })` |\n| `workspace.Gravity = n` | `FG:SetGravity(n)` |\n| `root.Anchored = b` | `FG:SetAnchored(character, b)` |\n| `root:ApplyImpulse(v)` | `FG:ApplyImpulse(character, v, ruleNameOrTable)` |\n| `root.AssemblyLinearVelocity = v` | `FG:SetVelocity(character, v, ruleNameOrTable)` |\n\nOther calls: `FG:SetState / ClearState / HasState` (your own state names, used\nby Allow rules), `FG:Grant / Revoke` (for client-side mechanics like a sprint),\n`FG:CreateRemote(name, contract)` (register a client action),\n`FG:IsTracked / GetVerifiedCFrame / GetScore / GetShadow` (read-only queries).\n\n## Report shots (aim detection)\n\n```lua\nFG:ReportShot(player, origin, direction, didHit, { Targets = enemies })\n```\n\nCall it once per shot from your own hit code. `direction` must be where the\nplayer *aimed*, before any weapon spread. FairGuard works out who they were\naiming at and runs four statistical detectors: `Aim.Perfect` (dead-center\nshots), `Aim.Snap` (flicks that land dead-center), `Aim.Reaction` (shots\nfaster than a human can react to a target appearing), and `Aim.Accuracy`\n(long-range hit rate). Each one tests its window of shots against a human\nbaseline and only flags when an honest player would do that less than about\n1 time in 100,000. They are Tier B: they can add up to a kick request but never\nto a ban on their own. Baselines and thresholds are in the `Aim` section of the\nModel; tune `AccuracyBaseline` to your game's weapons.\n\nLine-of-sight tracking for `Aim.Reaction` costs a few raycasts per second for\nplayers who have fired in the last 45 seconds, capped by `VisionBudgetMs`.\n\n## Register client actions\n\n```lua\nlocal shoot = FG:CreateRemote(\"Shoot\", {\n\tArgs = { \"Vector3\", \"Instance?\" },\n\tRate = 10,\n\tCooldown = 0.1,\n\tValidate = function(player, aim, target) return true end,\n})\nshoot.OnServerEvent:Connect(function(player, aim, target) end)\nshoot:FireClient(player, \"hit\")\n```\n\nEvery call passes: rate, alive, argument types, Allow rules (default deny),\ncooldown, limits, then your `Validate`. Anything not registered is dropped and\ncounted against the sender.\n\n## Swimming, vehicles, knockback\n\n**Swimming.** `Humanoid` state is reported by the client, so a `Swimming` claim\nonly exempts the air checks while terrain water is actually at the player\n(`Movement.VerifySwimming`, read from the terrain at most every 0.15 s). A claim\nwith no water behind it earns no exemption and is logged as `Movement.FakeSwim`.\nOnly terrain water counts; a Part that looks like water does not.\n\n**Climbing** works the same way (`Movement.VerifyClimbing`): a `Climbing` claim is\nbelieved only while a `TrussPart`, or a part carrying your `Movement.ClimbTag`,\nis within `ClimbReach` studs. Otherwise it is logged as `Movement.FakeClimb`.\nIf your game climbs on something else, tag it or turn the check off.\n\n**Model numbers win.** If you set `Movement.WalkSpeed` or `Movement.JumpHeight`,\nFairGuard applies them to the Humanoid at spawn, so the player and the\nexpectation can't disagree.\n\n**Vehicles.** Tag a seat, or any model above it, and describe it in the Model:\n\n```lua\nVehicles = {\n\tCar = { Tag = \"Car\", Speed = 90 },\n\tPlane = { Tag = \"Plane\", Speed = 220, Flies = true },\n},\n```\n\n`Speed` is the top horizontal speed in studs/s; `Climb` and `Fall` default to\n`Speed`; `Flies = true` lets the vehicle leave the ground freely. A seat that\nmatches no vehicle gets the generic `Movement.SeatedSpeed` allowance. Stepping\nout of a fast vehicle stays covered for a short grace period.\n\n**Anti-knockback.** When you push a player with `FG:ApplyImpulse` or\n`FG:SetVelocity`, FairGuard expects them to move. A push that carries them\nless than a small fraction of what it should is recorded as a miss; a\nsignificance test over the recent pushes (`Movement.AntiKnockback`, Tier B)\ndecides whether the misses are more than an honest player would produce. Pushes\ninto walls, seats, water, ladders or anchors are not judged. If most other\nplayers are also ignoring pushes, the pushes themselves are not taking effect\nand nobody is flagged. Settings are in the `Knockback` section.\n\n## The Model\n\n`FairGuard.Model` is a table inside the root module. Edit it in place.\nEvery section is optional; an empty Model runs on safe defaults.\n\n```lua\nAllow = {\n\t{ Name = \"Sprint\", When = { Granted = true }, Permit = { Speed = 24, Duration = 5 } },\n\t{ Name = \"Shoot\", When = { State = \"InRound\" }, Permit = { Actions = { \"Shoot\" } } },\n},\nZones = { Lobby = { Tag = \"LobbyZone\" } },\nActions = { Shoot = { Args = { \"Vector3\" }, Rate = 10 } },\n```\n\n\"When X is true, Y is permitted.\" Anything not permitted is denied. States are your\nown names, set with `FG:SetState(player, \"InRound\")`. Typos are\nreported in Studio with a \"did you mean\" suggestion. Every setting and its\ndefault is in `src/FairGuard/Core/Config.luau`.\n\n## active\n\n```lua\nFairGuard.active = false -- the anticheat sleeps\n```\n\nSleeping turns off the judging only: no verdicts, no rejections, no\nsnap-backs, no scoring, no kick or ban requests. The API keeps working, and the\nshadows keep following every player, so waking is instant. Use it for\ncutscenes, map loads, or tuning. Read live, so it can be flipped at any time.\n\n## Kick and ban are requests\n\nFairGuard never removes anyone on its own. It raises a request with an evidence\npackage, and your handler decides:\n\n```lua\nFG.BanRequested:Connect(function(request) request:Approve() end)\nFG.KickRequested:Connect(function(request) request:Reject(\"reviewed\") end)\n```\n\n`Approve` is the only path to `Player:Kick` / `BanAsync`. With no handler\nconnected, nobody is removed (suppression still runs). In Studio, `Approve`\nonly logs.\n\nOther events: `Flagged`, `Suppressed`, `Alerted`, `RequestDecided`.\n\n## What it does not solve\n\nHumanized aimbots, ESP data itself, alts and ban evasion, bugs in your own Allow\nrules, and backdoored server code. These are documented, not hidden.\n\n## Status\n\nWritten, not yet tested in Studio. Expect rough edges. Local development:\n`rojo serve dev.project.json`. Publishing uses `default.project.json`.\nEdit `wally.toml` to set your own Wally scope before publishing.\n","readmeTruncated":false}