How to Script a Boss Fight (Phases, Attacks, Aggro)

Advanced 14 min NPCs & AI

A boss brain: phase thresholds, telegraphed attacks, aggro tables and fair loot.

Skip the typing

Generate the whole system, every file wired up. Free during beta.

Build it for me

How it works, step by step

  1. 1

    Model the boss as a server-side state machine: idle → engaged → phases by HP thresholds.

  2. 2

    Aggro table tracks recent damage contributors; taunts adjust weights.

  3. 3

    Each attack is a coroutine with telegraph windup, active frames, recovery — interruptible by staggers.

  4. 4

    Phase transitions clear projectiles, grant i-frames and play a cinematic beat.

  5. 5

    Death rolls loot for the aggro table and fires a completion remote.

Concepts you'll use

  • Enemy FSMs
  • Aggro weighting
  • Telegraphed attack frames

Mistakes that cost you players

  • Boss logic on the client duplicates for every player — run once on the server.
  • Attacks without windups feel unfair; telegraphs sell fairness.

Every script above — written, placed & wired in ~30 seconds

Build it free 🔥

no card · full access in beta

Keep building

All topics