Understanding anti-cheat systems and false positives.
Validate all important actions server-side:
-- Client sends position
RegisterNetEvent('myresource:setPosition')
AddEventHandler('myresource:setPosition', function(x, y, z)
-- Validate position is reasonable
if math.abs(x) > 10000 then return end
-- Set position
end)Prevent rapid actions:
local lastAction = {}
RegisterNetEvent('myresource:action')
AddEventHandler('myresource:action', function()
local source = source
local now = GetGameTimer()
if lastAction[source] and now - lastAction[source] < 1000 then
return -- Too fast
end
lastAction[source] = now
-- Process action
end)Common causes: