agentleFS
blushneybusiness-glitchblushneybusiness-glitch/roblox-omniskills/skills/rbx-combat-hitreg/SKILL.md

rbx-combat-hitreg

Skill0 starsChanged 3 months agoMITView on GitHub

Hit registration doctrine — what the server must recompute, how far back in time it may trust a laggy client, and the sanity checks that separate a 120ms-ping player from a teleport exploiter. Use when players say "my hits don't register", "I got killed around a corner", "he hit me through a wall", when tuning lag compensation, or when designing any remote that reports a hit. Do not use for building the melee or gun system itself — load rbx-combat-melee or rbx-combat-ranged — or for general anti-exploit sweeps — load rbx-security-anticheat instead.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never skip the re-check "when the hint looks plausible".

    line 37
  2. Distinctive:

    Run all five; each is one comparison and each closes a different exploit:

    line 59

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

rbx-combat-hitreg

When to load

Any combat remote design review; "hits don't register" / "killed around corner" reports; rbx-combat routes here automatically for those complaints. Load alongside the damage subskill, not instead of it.

The trust ladder

Three architectures, in descending server cost and ascending exploit surface:

  1. Pure server — client sends "I attacked", server raycasts/box-checks from its own replica. Zero trust needed. Feels fine for melee (swing animations hide 50–100ms) and for any weapon under ~150 studs. Default; use it until players with >100ms ping complain.
  2. Client hint, server re-check — client sends its candidate targets; server re-runs the same hitbox from server positions and keeps only the intersection. The hint saves nothing computationally — its only job is telling the server which check to prioritize. Never skip the re-check "when the hint looks plausible".
  3. Lag-compensated (rewind) — server keeps a position history per character and validates the client's hit against where targets were at now - playerPing. This is what makes snipers fair at 150ms ping, and it is what causes "killed around a corner" for everyone else. Only pay for it on precision hitscan weapons.

Rewind windows

  • Record each character's CFrame every Heartbeat into a ring buffer; 60 entries ≈ 1s of history at 60Hz costs ~7KB per character — keep it.
  • Cap the rewind at 200ms. Beyond that you are validating against a world the victim never saw; corner-death complaints scale linearly with the cap. 350ms+ ping players get rung-2 treatment (their hits validate against present positions and they miss more — that is the correct trade).
  • Compute ping from player:GetNetworkPing() (returns seconds, one-way ≈ half RTT is already applied — read the current docs behavior, it has changed before) and clamp the looked-up history index, never trust a client-sent timestamp.
  • Interpolate between the two nearest buffer entries; snapping to the nearest sample adds up to 16ms of error, which is a whole hitbox at sniper ranges.

Server sanity checks on every claimed hit

Run all five; each is one comparison and each closes a different exploit:

  1. Range: distance(attacker, victim at rewind time) ≤ weaponRange + 10-stud latency allowance. Catches teleport-to-target.
  2. Line of sight: raycast attacker eye → victim torso at rewind time, whitelist-ignoring both characters; a wall in between voids the hit. Catches shoot-through-walls.
  3. Rate: timestamp gap since last accepted hit ≥ weapon interval × 0.9. Catches macro/remote-spam fire.
  4. Facing (melee only): dot(attacker LookVector, toVictim) > 0.3 — you cannot land a sword swing on someone behind you.
  5. State: attacker alive, not stunned, weapon actually equipped (check the server's inventory record, not a client string).

Fail = drop silently and increment a per-player strike counter; kick or flag at ~10 strikes per minute via rbx-security-anticheat. Never punish a single failure — packet reorder produces legitimate ones.

Making rung 1 feel like rung 3

Most "bad hitreg" is feedback latency, not registration. Before adding rewind: client plays swing/muzzle VFX and sound on input (0ms perceived), server confirms within ~1 RTT, damage number appears on confirmation. With that split, pure-server melee at 100ms ping is indistinguishable from compensated melee in blind tests — spend the rewind budget on hitscan snipers only.

Sharp edges

  • CRITICAL — Trusting a client-sent timestamp for the rewind lookup: the exploiter picks the most favorable 200ms of history every shot. Derive time from server clock minus measured ping, always.
  • CRITICAL — Validating range against the victim's current position while dealing damage from a rewound hit: fast-moving victims fail the check and lagging attackers hit-reg drops. All five sanity checks read the same rewound snapshot.
  • HIGH — Ring buffer never pruned for despawned characters: 50-player server leaks ~350KB/min after respawn waves. Clear the buffer on CharacterRemoving.
  • HIGH — LOS raycast filtering only the attacker: the victim's own limbs block the torso ray and legit hits void. Exclude both characters and CanCollide-false decor.
  • MEDIUM — Testing hitreg in Studio without network simulation: Studio RTT ≈ 0 so every rung looks identical. Use Studio's incoming-latency simulation at 100ms and 250ms before judging feel.

Load with

rbx-combat-melee / rbx-combat-ranged (the systems this validates), rbx-security — don't ask, include it per the rbx-combat router. rbx-security-anticheat for the strike escalation, rbx-net-remotes for payload typing, rbx-qa-scale for multi-client latency testing.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.