Tamper → Strikes

Strikes

A strike is the unit of suspicion Tamper tracks per player. Passive detection issues strikes automatically; you can also issue them manually from middleware or route handlers when you detect bad data.

Signatures

Tamper.Strike(player: Player, reason: string?)
Tamper.GetStrikes(player: Player) → number
Tamper.Reset(player: Player)

Behaviour

MethodDescription
StrikeIncrements the player's strike count by 1. If the count reaches the configured threshold, the autokick or onKick callback fires immediately. The optional reason string is passed to the callback.
GetStrikesReturns the current strike count for the player. Returns 0 if the player has no recorded strikes.
ResetSets the player's strike count back to 0. Useful after a false-positive, or when a trusted action clears suspicion.

Example: manual strike on bad data

local Tamper = RoExpress.Tamper

app:Post("trade", function(req, res)
    local data = req.data

    if not data or not data.itemId or type(data.itemId) ~= "number" then
        Tamper.Strike(req.player, "missing or invalid itemId in trade payload")
        return res:Error(400, "Bad request")
    end

    -- process trade...
    res:Send({ ok = true })
end)
Strikes persist for the lifetime of the server session. They are not saved to DataStore automatically. If you need persistent bans, act inside your onKick callback.

See also

← Tamper  ·  Configuration | set the threshold and autokick behaviour  ·  Version Checking | silent drop on version mismatch