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

rbx-combat-melee

Skill0 starsChanged 3 months agoMITView on GitHub

Melee combat that feels like a top battlegrounds game — server-side hitboxes, escalating combos, block/parry with real frame windows, knockback finishers. Use when the user says "make a sword", "add melee/fists/punching", "combo system", "add blocking/parrying", or when existing melee feels floaty, spammy, or hits through blocks. Do not use for guns and projectiles — load rbx-combat-ranged — or for "hits don't register" complaints — load rbx-combat-hitreg instead.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check os.clock() - stateStartTime <= 0.15 on the defender's Blocking state when the server resolves the swing.

    line 51
  2. Very specific:

    Create OverlapParams/RaycastParams once per weapon, not per swing.

    line 65
  3. Very specific:

    Read: module-library.md (an existing CombatStateMachine/DamageCalculator ships again unchanged), the game's projects.md block (weapon …

    line 90
  4. Very specific:

    Write: tuned timing/hitbox constants per weapon into the game's projects.md block once the user approves the feel.

    line 92

≈ “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-melee

Laws

  1. Client sends intent, server swings. The attack remote carries zero arguments — no targets, no damage, no positions. The server runs the hitbox from its own copy of the attacker's HumanoidRootPart and applies every HP change. A remote that accepts a target list is an exploit, not a feature.
  2. One state machine gates everything. Idle → Attacking → Recovery → Idle, with Blocking, Dodging, and Stunned as interrupts. Every action request checks canTransition first; attacking while stunned or blocking while mid-swing must be impossible server-side, not merely un-animated client-side.
  3. Spatial query for melee, raycast for thrusts. workspace:GetPartBoundsInBox with an OverlapParams excluding the attacker's character is the default swing hitbox; a single raycast only suits narrow stabs (spears). Never .Touched — it fires on physics contact, which lags, double-fires, and misses fast swings.
  4. Every landed hit is felt. Impact VFX + hit sound + damage number + 0.05–0.10s hit-stop, per the rbx-combat router defaults. A silent hit reads as broken even when the HP moved.
  5. Dedup per swing. Track hit characters in a set for the swing; one target takes one hit per swing, and cap targets at 5 to close AoE farming.

Recipes

Hitbox dimensions (box CFrame = root × CFrame.new(0, 0, -range/2)): dagger/fist 4–5 × 4 × 5 studs, sword 6–8 × 5 × 6, greatsword 8–12 × 7 × 7, spear 10–14 × 3 × 5, AoE slam 8–10 × 10 × 8 (range × width × height).

Timing set (the tuned defaults; change one, retest feel): attack active 0.35s, recovery 0.4s, attack cooldown 0.3s server-enforced, combo window 0.8s after each hit, max combo 4, dodge 0.5s with 1.5s cooldown, default stun 1.0s.

Combo escalation: hit 1 ×1.0 → hit 2 ×1.1 → hit 3 ×1.25 (widen box to 7 studs) → hit 4 ×1.5 finisher with knockback. Combo count lives in the server state machine; it resets to 0 when recovery expires without a chained input.

Block/parry: blocking cuts incoming damage 80%; a block started within 0.15s (~9 frames at 60fps) before the hit lands is a parry — zero damage, attacker stunned 1.2s. Check os.clock() - stateStartTime <= 0.15 on the defender's Blocking state when the server resolves the swing. Parry stun is the counterplay budget: heavy weapons get wider parry windows, not more damage.

Knockback: LinearVelocity on the target's RootAttachment (never the deprecated BodyVelocity), force 50 for finishers, destroyed after 0.3s. Dodge = same helper on self, force 60 forward, plus a 0.5s invulnerability tag the hitbox loop checks.

Damage: route through one calculator — base × buffs × (1 − defense, capped 0.9) × crit × combo multiplier, floored at 1. Clamp every multiplier; uncapped buff stacking is how one exploit turns into ×∞ damage.

Performance budget

Create OverlapParams/RaycastParams once per weapon, not per swing. One Heartbeat loop updates all state machines — never one loop per player. Damage-number BillboardGuis come from a pool (rbx-juice-numbers). At 20+ fighters, pre-filter hitbox candidates by distance before the bounds query.

Load with

rbx-vfx-impacts, rbx-audio-sfx — every hit is seen and heard, don't ask, include both. rbx-juice-numbers for damage numbers, rbx-juice-screenfx + rbx-camera-shake for hit-stop and shake, rbx-physics-ragdoll for kill spectacle, rbx-anim-rigs when swings need real character animations. Validation depth: rbx-combat-hitreg.

AI-tells

  • ☐ Attack remote carries targets, damage, or a position argument
  • ☐ .Touched-based sword hitbox
  • ☐ Cooldown or combo count tracked only on the client
  • ☐ Hits land with no VFX, sound, or hit-stop
  • ☐ One target hit twice by the same swing (no per-swing dedup set)
  • ☐ Block state that still allows attacking (no state machine)
  • ☐ BodyVelocity used for knockback
  • ☐ New OverlapParams constructed inside the swing handler

Memory

Read: module-library.md (an existing CombatStateMachine/DamageCalculator ships again unchanged), the game's projects.md block (weapon roster, damage scale already in play). Write: tuned timing/hitbox constants per weapon into the game's projects.md block once the user approves the feel; reusable state-machine and knockback modules into module-library.md.

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.