How to make Roblox exploiters much less powerful
A practical Roblox anti-exploit guide with working Luau: validated remotes, rate limits, movement and economy checks, suspicion scoring, and honest client signals.
On this page
Every popular Roblox game gets exploited. You will not stop that, and any anti-cheat that promises to is overselling.
What you can control is what an exploiter gets out of it. If a compromised client can mint money, hurt players from across the map and read your unreleased content, the game is broken. If the same client can only fire remotes that get quietly rejected, the exploiter has a boring session.
I went looking at how aggressive client anti-cheats work: executor checks, hook detection, self-integrity, even wiping the local DataModel on detection. I kept arriving at the same conclusion. The clever client code is the least important part of the system. The boring server code is the part that actually works.
So this post is the order I would build things in, with code you can lift.
All the code below is Luau, written for strict mode, and meant as a starting point. I have not tuned the thresholds for your game, and neither can anyone else. Measure first.
What an exploiter actually controls#
Before defending anything it helps to be exact about the attacker. Roblox's replication model already removes a lot of power: a client cannot simply edit the server's world. What remains is smaller than people fear, but stranger than they expect.
| An exploiter can | An exploiter cannot (unless your server code lets them) |
|---|---|
| Read everything that replicates: LocalScripts, replicated modules, remote names, UI, parts | Read ServerScriptService or ServerStorage |
| Fire any remote, any number of times, with any arguments | Change server-side state directly |
| Run their own code inside your game's client | Edit another player's data or inventory |
| Change anything local: UI, camera, lighting, effects | Skip a decision the server makes |
| Drive their own character and any physics they own: position, velocity, movement properties | Run code on the server |
Two rows matter more than the rest.
First, the client drives its own character. Movement is client-authoritative by default, so the server has to verify it after the fact.
Second, everything that replicates is readable. Information cheats like ESP are a replication problem, not a validation problem. Both come back later.
Spend your effort in order of damage:
- economy and saved data
- progression skipping
- griefing other players
- information advantages
- cosmetic annoyance
Rule one: the server owns the outcome#
A RemoteEvent should never mean "do exactly what the client says". It should mean "the client is asking for this, check whether it is valid".
Bad:
GiveMoney.OnServerEvent:Connect(function(player, amount)
player.leaderstats.Cash.Value += amount
end)
The client picks the amount, so the exploiter picks the amount.
Better:
local REWARD = 250
ClaimReward.OnServerEvent:Connect(function(player)
local profile = Profiles[player]
if not profile or profile.HasClaimedReward then
return
end
profile.HasClaimedReward = true
profile.Cash += REWARD
end)
The client asks. The server decides the value, checks the claim history and writes the data itself. The same shift applies to almost every remote you will write:
| Too much control | Narrow intent |
|---|---|
SetCash(amount) | ClaimDailyReward() |
GiveItem(item) | PurchaseItem(itemId, quantity) |
DamagePlayer(target, damage) | FireWeapon(origin, direction) |
SetPosition(position) | RequestTeleport(destinationId) |
SpawnObject(className, properties) | RequestVehicleSpawn(vehicleId) |
The narrower the remote, the less there is to validate and the less an exploiter can say with it.
One remote boundary instead of forty validators#
Most games validate remotes by discipline: every handler remembers to check its arguments. That fails by omission. One forgotten check on remote number 37 and you have your exploit.
The fix is structural. Put every remote behind one wrapper so the safe path is the only path. The wrapper rate-limits first (garbage should be cheap to reject), then validates every argument, then runs your handler inside a pcall.
--!strict
-- Net.luau
local Players = game:GetService("Players")
local Security = require(script.Parent.Security)
type Validator = (unknown) -> any?
type Options = {
rate: number,
burst: number,
args: { Validator },
handler: (Player, ...any) -> (),
}
local V = {}
function V.string(maxLength: number): Validator
return function(value)
if typeof(value) == "string" and #value <= maxLength then
return value
end
return nil
end
end
function V.integer(min: number, max: number): Validator
return function(value)
-- nan, inf and fractions each fail one of these checks
if typeof(value) == "number" and value >= min and value <= max and value % 1 == 0 then
return value
end
return nil
end
end
function V.oneOf(allowed: { [string]: boolean }): Validator
return function(value)
if typeof(value) == "string" and allowed[value] then
return value
end
return nil
end
end
function V.instanceIn(container: Instance): Validator
return function(value)
if typeof(value) == "Instance" and value:IsDescendantOf(container) then
return value
end
return nil
end
end
function V.vector3(maxMagnitude: number): Validator
return function(value)
-- written as <= so nan and inf are rejected too
if typeof(value) == "Vector3" and value.Magnitude <= maxMagnitude then
return value
end
return nil
end
end
local buckets: { [Player]: { [string]: { tokens: number, last: number } } } = {}
local function take(player: Player, key: string, rate: number, burst: number): boolean
local now = os.clock()
local perPlayer = buckets[player]
if not perPlayer then
perPlayer = {}
buckets[player] = perPlayer
end
local bucket = perPlayer[key]
if not bucket then
bucket = { tokens = burst, last = now }
perPlayer[key] = bucket
end
bucket.tokens = math.min(burst, bucket.tokens + (now - bucket.last) * rate)
bucket.last = now
if bucket.tokens < 1 then
return false
end
bucket.tokens -= 1
return true
end
local function bind(name: string, remote: RemoteEvent, options: Options)
remote.OnServerEvent:Connect(function(player: Player, ...: any)
if not take(player, name, options.rate, options.burst) then
Security.flag(player, "rate_limit", 1, name)
return
end
if select("#", ...) > #options.args then
Security.flag(player, "extra_args", 2, name)
return
end
local raw = { ... }
local clean = table.create(#options.args)
for i, validate in options.args do
local value = validate(raw[i])
if value == nil then
Security.flag(player, "bad_arg", 2, `{name}#{i}`)
return
end
clean[i] = value
end
local ok, err = pcall(options.handler, player, table.unpack(clean))
if not ok then
warn(`[net] {name} failed: {err}`)
end
end)
end
Players.PlayerRemoving:Connect(function(player)
buckets[player] = nil
end)
return { bind = bind, v = V }
Security.flag is a small scoring module I show later. For now read it as "record this".
A few details are worth spelling out.
NaNfails every comparison, sovalue >= min and value <= maxrejects it along with infinity, and no special case is needed.- If the server does not know about an Instance the client passes, it arrives as
nil. The validators treatnilas invalid. - Argument tables are the one thing I have deliberately not built a validator for. Avoid tables as remote arguments. If you must accept one, cap its size and validate every field.
Usage looks like this:
local Net = require(script.Parent.Net)
local v = Net.v
Net.bind("EquipItem", Remotes.EquipItem, {
rate = 4,
burst = 6,
args = { v.oneOf(ItemIds) },
handler = function(player, itemId: string)
local profile = Profiles[player]
if not profile or not table.find(profile.OwnedItems, itemId) then
Security.flag(player, "equip_unowned", 2, itemId)
return
end
equipItemOnServer(player, itemId)
end,
})
An exploiter can still fire EquipItem. It just does not achieve anything.
Context beats values#
Valid arguments are only the start. The real question is whether the action is possible right now.
A vending machine remote is a good example. The argument can be a perfectly real Instance and the request can still be nonsense because the player is on the other side of the map.
local MAX_REACH = 12
local LATENCY_SLACK = 4
Net.bind("UseVendingMachine", Remotes.UseVendingMachine, {
rate = 2,
burst = 3,
args = { v.instanceIn(workspace.VendingMachines) },
handler = function(player, machine: Instance)
local character = player.Character
local root = character and character:FindFirstChild("HumanoidRootPart")
if not (root and root:IsA("BasePart") and machine:IsA("PVInstance")) then
return
end
if (root.Position - machine:GetPivot().Position).Magnitude > MAX_REACH + LATENCY_SLACK then
Security.flag(player, "out_of_reach", 2, machine.Name)
return
end
useMachine(player, machine)
end,
})
Note the slack. The server sees where the player was a moment ago, not where they are on their screen. A distance check with no tolerance will punish honest players with bad ping.
The same pattern covers shops, pickups, doors, terminals, objectives and vehicle controls.
Order matters too#
Many exploits send perfectly valid data at a moment when that action should be impossible. A small state machine on the server rejects those:
local allowed = {
Idle = { UsingTerminal = true },
UsingTerminal = { SelectingItem = true, Idle = true },
SelectingItem = { Purchasing = true, UsingTerminal = true, Idle = true },
Purchasing = { Idle = true },
}
local flow: { [Player]: string } = {}
local function transition(player: Player, to: string): boolean
local from = flow[player] or "Idle"
if not allowed[from][to] then
return false
end
flow[player] = to
return true
end
If a purchase arrives and transition(player, "Purchasing") returns false, the player never opened the terminal. Reset the state on death, on leaving the terminal and in PlayerRemoving.
Pacing beats cooldowns for autofarming#
A flat cooldown stops spam. It does not stop an exploiter who calls a legitimate remote at the fastest legitimate rate forever. Make the server enforce minimum plausible durations: a delivery cannot complete faster than the shortest route, a mining node cannot be cleared faster than the fastest tool allows. Then autofarming cannot do better than a good honest player.
Footguns that keep working#
These are the mistakes I would check for first in any game.
| Footgun | Why it hurts | Fix |
|---|---|---|
Negative, fractional, NaN or huge numbers | BuyItem("sword", -5) pays the player | v.integer(min, max) on every number |
| Trusting an Instance's name or properties | The client picks which Instance to pass | Check the container, then look the thing up in your own server table |
InvokeClient on a RemoteFunction | A client that never returns can hang that thread forever | Use events and reply with another event |
Reading Humanoid.WalkSpeed, JumpPower or character position as truth | The owning client can change them and the change replicates | Keep server-owned values and compare against those |
| Authorising admins by name or a client flag | Names change, flags are forgeable | Check UserId or group rank on the server on every call |
| Check, then yield, then write | Spamming a remote can double-spend while the first call is yielding | Lock per player, or do the whole thing without yielding |
Prices, permissions or config in ReplicatedStorage | Readable by everyone, and it tells them what to target | Keep it in ServerStorage |
| Per-player tables never cleaned up | Slow memory leak | Clear them in PlayerRemoving |
Movement: verify the character after the fact#
The client owns its character, so the server cannot prevent movement cheats. It can only detect them and correct them. Three rules make this work.
- Compare against a speed the server decided on, never against
Humanoid.WalkSpeed. That property is one the client can change. - Remember your own interventions. If the server launched, teleported or seated a player, give them a grace window.
- Require repeated violations and correct before you punish. One bad sample is lag.
--!strict
-- Movement.luau
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Security = require(script.Parent.Security)
local SAMPLE_INTERVAL = 0.5
local SLACK = 1.4
local STRIKES_TO_FLAG = 3
local SPAWN_GRACE = 3
type State = {
lastPosition: Vector3,
lastTime: number,
lastGood: CFrame?,
strikes: number,
graceUntil: number,
allowedSpeed: number,
}
local states: { [Player]: State } = {}
local Movement = {}
-- the server decides how fast a player may go, never the humanoid
function Movement.setAllowedSpeed(player: Player, speed: number)
local state = states[player]
if state then
state.allowedSpeed = speed
end
end
-- call after any server-side teleport, launch or knockback
function Movement.grace(player: Player, seconds: number)
local state = states[player]
if state then
state.graceUntil = math.max(state.graceUntil, os.clock() + seconds)
end
end
local function track(player: Player)
local state: State = {
lastPosition = Vector3.zero,
lastTime = os.clock(),
lastGood = nil,
strikes = 0,
graceUntil = os.clock() + SPAWN_GRACE,
allowedSpeed = 16,
}
states[player] = state
player.CharacterAdded:Connect(function()
state.graceUntil = os.clock() + SPAWN_GRACE
state.lastGood = nil
end)
end
local accumulator = 0
RunService.Heartbeat:Connect(function(dt)
accumulator += dt
if accumulator < SAMPLE_INTERVAL then
return
end
accumulator = 0
local now = os.clock()
for player, state in states do
local character = player.Character
local root = character and character:FindFirstChild("HumanoidRootPart")
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if not (character and root and root:IsA("BasePart") and humanoid) then
continue
end
local position = root.Position
local elapsed = now - state.lastTime
-- horizontal only, falling and jumping are not suspicious
local flat = Vector3.new(position.X - state.lastPosition.X, 0, position.Z - state.lastPosition.Z)
state.lastPosition = position
state.lastTime = now
local exempt = now < state.graceUntil or humanoid.SeatPart ~= nil or humanoid.Health <= 0
if exempt or elapsed <= 0 then
state.strikes = 0
state.lastGood = root.CFrame
continue
end
local speed = flat.Magnitude / elapsed
if speed > state.allowedSpeed * SLACK then
state.strikes += 1
if state.strikes >= STRIKES_TO_FLAG then
Security.flag(player, "speed", 3, string.format("%.1f vs %.1f", speed, state.allowedSpeed))
if state.lastGood then
character:PivotTo(state.lastGood)
end
state.strikes = 0
state.graceUntil = now + 1
end
else
state.strikes = 0
state.lastGood = root.CFrame
end
end
end)
Players.PlayerAdded:Connect(track)
for _, player in Players:GetPlayers() do
track(player)
end
Players.PlayerRemoving:Connect(function(player)
states[player] = nil
end)
return Movement
Call Movement.setAllowedSpeed whenever your game changes a player's speed (sprint, a potion, a vehicle exit), and Movement.grace after anything the server does to their position.
This catches blatant speed hacks and teleports. It does not catch someone who stays under the slack, and a cheater who only gains 30% speed is barely cheating. Flying needs a different check, such as measuring how long a player stays airborne without a plausible fall. Noclip is hard to detect cheaply and has a high false-positive rate, so I would skip it unless it is actually hurting you.
Combat: the client reports intent, the server raycasts#
The most common weapon mistake is a remote shaped like Hit(target, damage). Do not send hits. Send the shot and let the server decide what it hit.
Net.bind("FireWeapon", Remotes.FireWeapon, {
rate = 15,
burst = 5,
args = { v.vector3(50000), v.vector3(1.1) },
handler = function(player, origin: Vector3, direction: Vector3)
local weapon = Combat.equipped(player)
local character = player.Character
local head = character and character:FindFirstChild("Head")
if not (weapon and character and head and head:IsA("BasePart")) then
return
end
local now = os.clock()
if weapon.ammo <= 0 or now - weapon.lastShot < weapon.fireInterval * 0.9 then
Security.flag(player, "fire_rate", 1, weapon.name)
return
end
-- the camera sits a little off the head, but never in another room
if (origin - head.Position).Magnitude > 8 or direction.Magnitude < 0.9 then
Security.flag(player, "bad_shot", 2, weapon.name)
return
end
weapon.lastShot = now
weapon.ammo -= 1
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = { character }
local result = workspace:Raycast(origin, direction.Unit * weapon.range, params)
local victim = result and result.Instance:FindFirstAncestorOfClass("Model")
if victim then
Combat.applyDamage(player, victim, weapon.damage)
end
end,
})
Combat.equipped is your own server-side weapon state. Ammo, fire interval, range and damage all live there. The client contributes two vectors and nothing else.
One honest limitation: the server sees targets where they were roughly half a round trip ago, so some legitimate hits will miss. You can accept that, or keep a short position history and rewind. Lag compensation is its own post.
The economy#
Economy exploits do the most lasting damage, because they poison every player's progress, not just a session.
Keep prices and balances on the server, and make spending atomic. The client sends PurchaseItem(itemId, quantity). It never sends a price.
The quiet bug is check, then yield, then write. If anything yields between "can they afford it" and "deduct it", an exploiter can fire the remote fifty times while the first call is still waiting. A per-player lock closes that gap:
local locks: { [Player]: boolean } = {}
local function withLock(player: Player, fn: () -> ())
if locks[player] then
return
end
locks[player] = true
local ok, err = pcall(fn)
locks[player] = nil
if not ok then
warn(err)
end
end
Net.bind("PurchaseItem", Remotes.PurchaseItem, {
rate = 2,
burst = 3,
args = { v.oneOf(Catalog.ids), v.integer(1, 20) },
handler = function(player, itemId: string, quantity: number)
withLock(player, function()
local profile = Profiles[player]
local price = Catalog.price(itemId) * quantity
if not profile or profile.Cash < price then
return
end
profile.Cash -= price
addToInventory(profile, itemId, quantity)
end)
end,
})
In this exact snippet nothing yields, so the lock is belt and braces. The day you add a DataStore or Marketplace call in the middle, it is what stops the double spend. The v.integer(1, 20) is what stops quantity = -5.
Make Robux purchases idempotent. Roblox can call ProcessReceipt more than once for the same purchase, so a grant must be safe to repeat. Record the PurchaseId and only report success once the record is saved:
MarketplaceService.ProcessReceipt = function(info: { [string]: any })
local player = Players:GetPlayerByUserId(info.PlayerId)
local profile = player and Profiles[player]
local grant = Products[info.ProductId]
if not (player and profile and grant) then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if not profile.Receipts[info.PurchaseId] then
grant(player, profile)
profile.Receipts[info.PurchaseId] = true
end
-- keep answering "not yet" until the record is actually saved
if not saveProfile(profile) then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Prevent cross-server duplication. If a player can be in two servers at once and both write their data, items can duplicate. Use session locking, either through a library like ProfileService or ProfileStore or your own. It is the single most effective fix for a whole family of dupe exploits.
Make trades atomic. Lock both players, validate both sides, then swap in one step with no yield in the middle.
Watch your own economy. Log unusually large or unusually fast balance changes. Telemetry will catch the exploit you did not think of.
Turning signals into decisions#
Every rejected action is a data point. One data point means little. A pile of them means a lot. So rather than a pile of unrelated if statements that kick people, route everything through one scoring module.
--!strict
-- Security.luau
local Players = game:GetService("Players")
local DECAY_PER_SECOND = 0.1
local RESTRICT_AT = 10
local KICK_AT = 30
local MAX_DETAIL = 80
type Record = { score: number, updated: number }
type Event = { [string]: any }
local records: { [Player]: Record } = {}
local sink: ((Event) -> ())? = nil
local Security = {}
function Security.setSink(fn: (Event) -> ())
sink = fn
end
local function current(player: Player): number
local record = records[player]
if not record then
return 0
end
return math.max(0, record.score - (os.clock() - record.updated) * DECAY_PER_SECOND)
end
function Security.flag(player: Player, code: string, weight: number, detail: any?)
local score = current(player) + weight
records[player] = { score = score, updated = os.clock() }
local event: Event = {
userId = player.UserId,
jobId = game.JobId,
code = code,
weight = weight,
score = score,
-- clients control this string, so bound it
detail = string.sub(tostring(detail or ""), 1, MAX_DETAIL),
time = os.time(),
}
if sink then
task.spawn(sink, event)
end
if score >= KICK_AT then
-- generic on purpose, do not tell them which check fired
player:Kick("You were removed from this server. Please rejoin.")
end
end
function Security.isRestricted(player: Player): boolean
return current(player) >= RESTRICT_AT
end
Players.PlayerRemoving:Connect(function(player)
records[player] = nil
end)
return Security
Scores decay over time, so occasional noise from lag or a loading hitch never accumulates into a punishment. Sustained, repeated, independent signals do.
Weights are where your judgement goes. Mine are a starting point:
| Signal | Suggested weight |
|---|---|
| Missed client heartbeat | 1 |
| Rate-limit hit | 1 |
| Invalid argument or extra args | 2 |
| Out-of-reach interaction | 2 |
| Sustained speed violation | 3 |
| Honeypot remote fired | 10 |
| Repeated impossible economy action | 5 and up |
No single weak signal can reach the kick threshold by itself. That is the point.
The response ladder#
| Score | What happens |
|---|---|
| Any | Reject the invalid action and log it |
| Rising | Increase scrutiny on that session, for example tighter rate limits |
At RESTRICT_AT | Sensitive systems (trading, purchasing, rewards) check Security.isRestricted(player) and refuse |
At KICK_AT | Kick with a generic message |
| After review | Ban with Players:BanAsync, keeping your evidence in PrivateReason |
Permanent bans should come from high-confidence rules or a human looking at the log, not from a score alone.
Operating it#
- Ship every new rule in shadow mode. Let it log and score, but not restrict or kick, for a week. Compare how often it fires against how often you would expect a cheater. If it fires on a lot of players, the rule is wrong, not the players.
- Give yourself a kill switch. Read rule thresholds from a config you can change without publishing, so a bad rule shipped on Friday night can be turned off in one step.
- Log enough to investigate.
UserId,JobId, timestamp, rule, a bounded detail string, the current score and the action taken. Without this, moderation is guesswork. - Stay quiet. A loud message like "speed hack detected" tells the exploiter which check to defeat. Reject, restrict and remove without explanation.
- Watch for spikes after updates. If a rule suddenly fires on a lot of players the day you ship a feature, that is a false positive.
Honeypots#
A honeypot remote is one that legitimate code never fires. Create it on the server so it replicates, give it a boring plausible name, and flag anyone who touches it.
local bait = Instance.new("RemoteEvent")
bait.Name = "GrantCash"
bait.Parent = Remotes
bait.OnServerEvent:Connect(function(player)
Security.flag(player, "honeypot", 10, bait.Name)
end)
Do not name it something silly like BAN_ME. Do not ban on it either: a script that blindly fires every remote it finds will hit it, and so might a buggy tool. Treat it as one unusually strong signal among several.
What client-side detection is actually good for#
The detections I found in aggressive anti-cheats are real, and some are clever. Here is what each is worth.
| Technique | What it catches | Why it is not enough |
|---|---|---|
| Scanning for executor-style globals | Lazy, off-the-shelf scripts | Names change, the check runs in the environment it is policing, and the attacker can read it |
| Function integrity (is this builtin still the original) | Naive hooks | A competent hook answers the check the way the real function would |
| Self-integrity (is my own script intact) | Crude deletion or disabling | The check also lives on the client |
| Known-bad asset or service signatures | Known tooling | Always one version behind |
| Memory fluctuation | Almost nothing alone | Games allocate constantly, so only usable as a weak hint |
| Re-running every check every frame | Raises the cost of one-shot bypasses | Costs frame time for every honest player |
| Wiping the local DataModel on detection | Disrupts the session | Fixes no vulnerability, can freeze or crash the client, and a false positive wrecks an honest player's game |
Every one of these shares a flaw. They run on a machine where the attacker has full control, so they can be observed, patched or skipped. That is why their value is as evidence for the server to weigh, not as a verdict.
The one I would build: a server-judged heartbeat#
The client-side idea I like is the one where the verdict lives on the server. The client fires a heartbeat remote every few seconds. The server notices when it stops.
If the anti-cheat script has been deleted or disabled, the heartbeat disappears, and the exploiter cannot hide the absence because the server is the one keeping time.
Server:
--!strict
local Players = game:GetService("Players")
local Net = require(script.Parent.Net)
local Security = require(script.Parent.Security)
local STALE_AFTER = 40
local lastBeat: { [Player]: number } = {}
local joined: { [Player]: number } = {}
Net.bind("Beat", Remotes.Beat, {
rate = 0.2,
burst = 3,
args = {},
handler = function(player)
lastBeat[player] = os.clock()
end,
})
local function track(player: Player)
joined[player] = os.clock()
end
Players.PlayerAdded:Connect(track)
for _, player in Players:GetPlayers() do
track(player)
end
Players.PlayerRemoving:Connect(function(player)
lastBeat[player] = nil
joined[player] = nil
end)
task.spawn(function()
while true do
task.wait(15)
local now = os.clock()
for _, player in Players:GetPlayers() do
local last = lastBeat[player] or joined[player]
if last and now - last > STALE_AFTER then
-- weak on purpose, slow loaders and laggy clients miss beats too
Security.flag(player, "missing_beat", 1)
end
end
end
end)
Client:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local beat = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("Beat")
while true do
beat:FireServer()
task.wait(10)
end
Be realistic about it. A determined exploiter can fire the same remote themselves. The heartbeat is not a lock. It is a cheap tripwire for the lowest-effort bypass, and it costs honest players nothing.
Do not counter-attack#
Some anti-cheat ideas cross from protecting the game into interfering with the player's machine, for example trying to hit executor filesystem functions. Do not. Your anti-cheat protects your game. If a player is malicious, reject their actions, preserve server state, record the evidence, remove them and moderate. Do not hack back.
Physics ownership#
Roblox can give clients network ownership of physical assemblies. That keeps things responsive, and it also means a client can influence the simulation of whatever it owns.
For anything that awards something (a ball, a crate, an objective item), either keep it server-owned with part:SetNetworkOwner(nil), or verify the outcome on the server before rewarding it. Server ownership costs responsiveness, so decide per object.
The question to ask is: can a client-controlled physics result cause an important server-side effect without verification? If yes, that path needs hardening.
What validation cannot fix#
Be honest with yourself about what is left over.
- ESP and wallhacks. The information is on the client because you sent it. The fix is to send less: use
StreamingEnabled, and replicate enemy information only when a player could plausibly know it. - Aimbots. Aiming is a legitimate input, so no argument check will catch a perfect one. Measure it server-side instead: accuracy, headshot ratio and snap-angle statistics over many fights. A statistical outlier is a signal for review, not an instant ban.
- Autofarming through legitimate remotes. Pacing rules and diminishing returns make this unprofitable. Validation cannot make it impossible.
- Copying replicated content. If it replicated, a serializer can reconstruct it. Keep unreleased content and sensitive logic in
ServerStorageand server-only modules, and never in anything the client receives.
Break your own game first#
The cheapest way to learn what your remotes do with garbage is to send them garbage. Run this from a client script in a private test place with the server output open:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remotes = ReplicatedStorage:WaitForChild("Remotes")
local junk = table.pack(
nil, true, -1, 0, 0.5, 1e308, math.huge, -math.huge, 0 / 0,
"", string.rep("a", 100000), {}, { {} }, Vector3.new(0 / 0, 0, 0),
workspace, game
)
for _, remote in remotes:GetChildren() do
if remote:IsA("RemoteEvent") then
remote:FireServer()
for i = 1, junk.n do
remote:FireServer(junk[i])
remote:FireServer(junk[i], junk[i], junk[i])
end
for _ = 1, 200 do
remote:FireServer()
end
end
end
Point Security.setSink at print while you do it. You will get flagged and kicked, which is the system working. What you are looking for is everything else:
- an unhandled server error, which means a validator is missing
- any change to saved data or balances
- server frame-time spikes, which means an expensive path with no rate limit
Run it again after every significant change. It is a regression test for your security.
Where to start#
If you only have a weekend:
- List every remote that touches money, items, damage, teams, teleporting or admin. Fix those first.
- Put all remotes behind the
Netboundary. - Add the
Securitymodule and have every rejection feed it, in shadow mode. - Add server-side movement checks and a grace call at every place the server moves a player.
- Add the heartbeat and one or two honeypots.
- Run the fuzz script, read the logs and tune.
Resist the urge to start with the client anti-cheat. It is the most fun part and the least valuable.
A checklist before you ship#
- Does the server validate every client-provided value, including
NaN, negatives and fractions? - Can the client choose a currency amount, a price, damage or a reward directly?
- Does every remote go through a rate limit?
- Do interactions check distance, state and ownership with sensible latency slack?
- Do purchases lock per player and compute prices on the server?
- Are Robux purchases idempotent and only acknowledged after saving?
- Is data session-locked across servers?
- Are admin actions authorised by
UserIdor group rank on the server every time? - Are secrets, prices and config out of anything replicated?
- If every anti-cheat LocalScript vanished right now, how much damage could an exploiter do?
- Are client detections treated as evidence instead of verdicts?
- Does every new rule run in shadow mode before it can restrict or kick?
- Do you have a way to turn a bad rule off without publishing?
- Do your logs let you tell an exploit from lag, a bug and a false positive?
The goal is not to make exploiting impossible#
You probably cannot stop a determined person from changing their own Roblox client, and that was never the goal.
The goal is to make the exploited client boring. They can inspect things. They can change their UI. They can fire remotes. They can wreck their own local session.
But whenever they try to make something important happen, the server asks one question: is this action actually possible and allowed? If the answer is no, nothing happens.
That is a much stronger defence than an endless race of hiding scripts, renaming remotes and adding more client checks, and it is the one that keeps working on the day your client anti-cheat gets bypassed.
