Roblox Parry Windows and Multi-Tick Abilities: Judging Timing on the Server When Client and Server Disagree

Has a playtester ever sworn they parried in time, only for the server to give the hit to their opponent anyway? If you build melee combat on Roblox, expect that report in the first week of testing. Expect both players to be telling the truth.
The disagreement is about timing, and hitboxes can't settle it. Our Roblox combat systems guide covers hitboxes and how the server checks where a swing lands. This guide covers the other half: deciding when an input happened, and whether the server should believe it.
Judge a parry by when it happened. The client stamps each press with workspace:GetServerTimeNow(). The server limits that claim using the player's measured ping, then compares it with the incoming hit.
Why Do Client And Server Disagree About Timing?
Each Roblox client sees the world a little late. It shows what the server sent some time ago, while the server has already moved on. With 120 milliseconds of round-trip latency, a player sees an enemy swing about 60 milliseconds after the server started it, and the parry press needs about another 60 milliseconds to reach the server.
So a parry pressed at exactly the right moment on screen can arrive about 120 milliseconds after the server already settled the hit. A server that judges by when inputs arrive punishes every player in proportion to their ping, which is the opposite of fair.
Clock drift adds to this. GetServerTimeNow() keeps the client's clock in step with the server's, but the client's estimate can still jitter by a few milliseconds and can jump after a network stall. Keep in mind that any system built on shared time has to allow for that small error.
There are three common ways to handle this. Each one trades fairness against how much room it leaves for cheating:
| Approach | What the server believes | Feels fair to | Exploit risk |
|---|---|---|---|
| Arrival time only | Nothing from the client | Low-ping players | Minimal |
| Trusted client timestamp | The client's claim, unchecked | Everyone, until someone forges a time | Severe, because a forged timestamp can parry anything |
| Limited client timestamp | The claim, held within the player's measured ping and a hard limit | Players below the limit | Limited to the allowed window |
This guide builds the limited approach. Most of the work is deciding where the limits sit and what happens at the edges.
What Should A Timestamped Input Carry?
The client's only job is to report when the player acted, using a clock the server shares. Roblox provides that clock with workspace:GetServerTimeNow(), which returns the same synchronized time on the client and the server.
Each parry or ability input should carry a small, fixed set of values, including:
- A sequence number. A per-player counter that goes up by one with every input. It lets the server reject repeated messages and notice dropped or out-of-order ones.
- The press timestamp. The GetServerTimeNow() value read when the input fired, not when the message was sent. A frame hitch can separate those two moments.
- The action identifier. Which ability or defensive move the input is for. This lets one RemoteEvent handle several actions without the server trusting any extra client state.
Note that the message never contains a result. The client says only that the player pressed parry at a given time, and the server decides what that press was worth.
```lua -- LocalScript: record the time of the press, not the time of sending local ParryRemote = game.ReplicatedStorage.Remotes.Parry local sequence = 0 local function onParryPressed() sequence += 1 local pressedAt = workspace:GetServerTimeNow() ParryRemote:FireServer(sequence, pressedAt) end ```If your project binds input through input actions, read the time inside the action's callback, not in a later render step. Our guide to Roblox input actions explains when those callbacks run within a frame.
Send a sequence number that goes up with every input, the GetServerTimeNow() value read at the press, and an action ID. Never send a result. The client reports what the player did and when, and the server decides what it was worth.
How Much Rewind Tolerance Should The Server Allow?
Rewind tolerance is how far back in time the server will accept a claimed timestamp. Set it too low and laggy players lose every close exchange. Set it too high and a player can watch the swing arrive, then parry after the fact.
A practical rule is to give each player their own averaged round-trip time plus a small margin, then cap that with one hard limit that applies to everyone. Player:GetNetworkPing() returns the round-trip time in seconds. It varies enough between readings that you should average several before relying on it.
```lua -- Server: decide how much of the client's claimed time to believe local MAX_REWIND = 0.2 -- hard limit in seconds, same for every player local FUTURE_EPSILON = 0.03 -- allowance for small clock jitter local PING_SLACK = 0.05 local function clampClaimedTime(player, claimed) if typeof(claimed) ~= "number" or claimed ~= claimed then return nil -- not a number, or NaN end local now = workspace:GetServerTimeNow() if claimed > now + FUTURE_EPSILON then return nil -- claims a time in the future end local allowed = math.min(MAX_REWIND, smoothedPing(player) + PING_SLACK) return math.max(claimed, now - allowed) end ```Here, smoothedPing is a helper that averages the last several GetNetworkPing() readings for that player. The function does three things in order. It rejects anything that isn't a real number (including NaN), rejects timestamps further in the future than the jitter allowance, and moves claims that are too old forward to the oldest time the server will accept.
Moving an old claim forward is gentler than rejecting it. A player on a bad connection still has the input counted, just at a later time that may or may not fall inside the parry window.
A hard limit of about 200 milliseconds is a reasonable default for melee. Above that latency, players will find the game stricter. Make that choice deliberately instead of discovering it in reviews.
Give each player their averaged round-trip ping plus about 50 ms of margin, capped by one hard limit near 200 ms. Move claims that are too old forward instead of rejecting them. Reject claims dated in the future.
Resolving A Parry Against A Pending Hit
Limiting timestamps solves half the problem. The other half is that the hit often reaches the server before the parry does, so the server must not apply damage the moment a hit is confirmed.
The fix is a short wait. When a hit lands, add it to a pending queue and give the defender a little time for a parry to arrive. If a parry stamped inside the window shows up during that wait, the hit becomes a parry. Otherwise, damage applies when the wait ends.
```lua local RunService = game:GetService("RunService") local PARRY_WINDOW = 0.2 -- seconds a parry stays active local HIT_HOLD = 0.1 -- seconds a hit waits for a late parry local pendingHits = {} local lastParry = {} -- defender -> limited parry start time local function queueHit(attacker, defender, hitTime) table.insert(pendingHits, { attacker = attacker, defender = defender, hitTime = hitTime, resolveAt = workspace:GetServerTimeNow() + HIT_HOLD, }) end local function parryCovers(defender, hitTime) local start = lastParry[defender] return start ~= nil and hitTime >= start and hitTime <= start + PARRY_WINDOW end RunService.Heartbeat:Connect(function() local now = workspace:GetServerTimeNow() for i = #pendingHits, 1, -1 do local hit = pendingHits[i] if parryCovers(hit.defender, hit.hitTime) then table.remove(pendingHits, i) applyParry(hit.attacker, hit.defender) elseif now >= hit.resolveAt then table.remove(pendingHits, i) applyDamage(hit.attacker, hit.defender) end end end) ```The hit's own time should be the attacker's swing timestamp, limited by the same clampClaimedTime function. That way both sides of the exchange are measured on the same clock, and neither player gains from arriving first.
Match the wait length to your rewind limit. There's no point waiting for a parry that the limit would push outside the window anyway. A wait of 80 to 120 milliseconds is short enough to hide behind an impact effect that the client plays right away and then confirms or cancels.
The last decision is who wins a true tie. Favoring the defender rewards good reads and feels generous, while favoring the attacker keeps aggressive play snappy. Whichever you choose, write the rule down and apply it the same way in every exchange.
Don't apply damage the moment a hit is confirmed. Hold it for about 100 ms. If a parry stamped inside its window arrives during that wait, turn the hit into a parry. Otherwise, apply damage when the wait ends.
Parry Costs And Cooldowns
A parry window needs a cost too, or players will just mash the button. Common patterns include:
- Miss cooldown. A failed parry locks the defender out for longer than the window lasts, so spamming costs more than it gains.
- Recovery time. A successful parry has its own short recovery, so one press can't cover a fast multi-hit combo.
- Server-tracked state. The server tracks each player's active window and cooldown. The client's animation is only visual.
All of these live on the server next to the pending-hit queue. A client that skips its own cooldown animation gains nothing, because the server ignores presses that arrive during the cooldown.
How Do You Budget Multi-Tick Abilities?
Multi-tick abilities, such as a flamethrower that burns every 0.25 seconds or a beam that hits eight times over two seconds, have a different timing problem. The risk is the server applying the wrong number of ticks, either because the client asked for extra ones or because a server stall bunched them together.
The rule: the client starts the ability, and the server handles every tick after that. The start time is the client's limited timestamp. The number of ticks owed at any moment is the elapsed server time divided by the tick interval.
```lua local MAX_CATCHUP = 2 -- most ticks one ability may apply in a single frame local function stepAbility(state, now) local elapsed = now - state.startedAt local owed = math.min(state.totalTicks, math.floor(elapsed / state.interval) + 1) local fired = 0 while state.ticksDone < owed and fired < MAX_CATCHUP do state.ticksDone += 1 fired += 1 applyTick(state.castId, state.ticksDone) end return state.ticksDone >= state.totalTicks end ```This follows the same accumulator pattern as fixed timestep game loops, with one difference that matters for combat. The catch-up cap limits how many ticks can apply in one frame, so a 300-millisecond stall spreads the owed ticks across the next few frames instead of landing them all at once.
Each tick also carries its cast ID and tick number. If applyTick records that pair, applying a tick becomes safe to repeat: a retry or duplicate code path can never apply tick four twice.
Besides the per-ability cap, the server needs an overall tick budget for busy moments. A raid where 30 players each run a channeled ability can produce hundreds of tick checks per second. Process a fixed number per Heartbeat and carry the rest into the next frame.
Start the cast at its limited timestamp, work out owed ticks from elapsed server time, and apply at most two per frame. Record each tick by cast ID and number so the same tick can never apply twice.
Test that budget under load before you pick a number. Our guide to Roblox performance profiling shows how to find where server frame time goes, which tells you whether combat processing is eating into your frame time.
Guarding The Timeline Against Exploits
Any system that accepts client timestamps invites forged ones. The rewind limit already reduces the damage, and a few more checks close the remaining gaps:
- Sequence numbers must go up. Reject any input whose sequence number isn't higher than the last one accepted from that player.
- Timestamps must go up. A player's claimed times should never run backward between inputs. A backward jump bigger than normal jitter strongly suggests forgery.
- Rate limits. Cap parry attempts and ability casts per second on the server, regardless of any client-side cooldown.
- Type checks. Check every RemoteEvent argument with typeof before doing math on it, because exploit tools can send tables, strings, or NaN.
Log rejected inputs instead of silently dropping them. A player who fails the future-timestamp check twenty times a minute is telling you something. Our Roblox anti-exploit guide covers how to respond to those signals in proportion.
How Do You Know Your Timing Rules Are Working?
Timing bugs are hard to spot in local tests, because a default Studio play session has almost no latency. Studio's network settings let you add incoming replication lag, which is the quickest way to feel what a 150-millisecond player feels.
Besides manual playtests, a few measurements keep the system honest:
- How often claims are limited. The share of inputs moved forward by the rewind limit, grouped by ping range, shows exactly which players the limit affects.
- Parry success rate by ping. If successful parries drop sharply above a certain latency, your wait time or rewind limit is too tight for those players.
- Ticks per cast. Every finished cast should apply exactly its configured number of ticks. Any difference points to a bug in catch-up or in duplicate protection.
Record a few disputed exchanges too, because a replay of the server's timeline settles arguments faster than a log. The approach in our guide to replay recording for browser games carries over to Roblox, as long as you record server timestamps instead of client frame counts.
Frequently Asked Questions
How wide should a parry window be on Roblox?
A 150 to 250 millisecond window is a common starting point for melee. Below about 120 ms, latency starts deciding fights, so widen the window before you raise the rewind limit.
Does GetNetworkPing return one-way or round-trip latency?
Player:GetNetworkPing() returns the round-trip time in seconds, measured by the engine. Halve it to estimate one-way latency, and average several readings before using it to set a rewind limit.
Should damage-over-time ticks use UnreliableRemoteEvent?
Only for visual feedback such as hit sparks. The server calculates and applies every damage tick itself, so a dropped visual message costs nothing and damage stays in order and under server control.
What happens to scheduled ability ticks when the server hitches?
Work out owed ticks from elapsed server time, apply at most two per frame, and never go past the ability's total tick count. Players lose a frame of smoothness, never get a burst of stacked damage.
How do I stop exploiters from sending fake timestamps?
Reject timestamps older than your rewind limit or later than server time plus a small allowance. Require each player's sequence numbers to go up, and enforce a parry cooldown on the server.
Putting Parry Timing Into Production
Fair timing on Roblox comes down to four server-side rules: stamp inputs on a shared clock, limit how far back you'll believe them, hold hits long enough for a parry to arrive, and let the server apply every tick of every channeled ability. None of these pieces is large, but each one closes a gap that players will otherwise find for you.
If you're building the rest of your game around this, start with how your Roblox server architecture splits authority between services. After that, the combat and anti-exploit guides cover the remaining layers.


