§ How to · with Forge AI
How to make a Roblox boss fight (with AI)
A Roblox boss fight needs five wired-up parts: phase transitions, attack telegraphs, per-player damage tracking, loot drops, and arena gates. Forge AI generates all five in 2m 10s — including pooled VFX so the arena does not stutter.
7 files · 420 lines · 2m 10s · 1 credit. Three phases out of the box, easily extended.
Phase transitions
Boss HP triggers phase 2 at 66%, phase 3 at 33%. Each phase changes attack pattern + speed.
Attack telegraphs
Red ground decals appear ~1s before AOE. Damage applies on decal disappearance, not on appear.
Per-player damage tracking
Each player's damage to the boss is tracked. Loot prioritises top damage dealers.
Loot drops
Server-side weighted loot table. Drops trigger on death, prioritise by damage rank.
Arena gates
Doors close on engagement, open on death or on timeout. No mid-fight escape exploit.
Pooled VFX
AOE decals and particle emitters pooled — no Instance.new on every attack. Smooth even with 20 players in the arena.
Files Forge AI ships for this prompt
7 files · 420 lines · 2m 10s · 1 credit
ServerScriptService/BossController.lua
Phase state machine + attack pattern dispatch
142 lines
ServerScriptService/AttackPatterns.lua
AOE, line-attack, summon-adds patterns
96 lines
ServerScriptService/DamageTracker.lua
Per-player damage table
38 lines
ServerScriptService/LootService.lua
Weighted loot table + delivery
56 lines
ServerScriptService/ArenaGate.lua
Door open/close on engagement
34 lines
ReplicatedStorage/Remotes/BossEvent
Server → all-client phase change announce
instance
StarterGui/BossHealthBar.lua
Top-screen boss HP bar with phase indicator
54 lines
Sample output: ServerScriptService/BossController.lua
--!strict
-- ServerScriptService/BossController.lua (Forge AI · excerpt)
local AttackPatterns = require(script.Parent.AttackPatterns)
local DamageTracker = require(script.Parent.DamageTracker)
local Boss = {}
Boss.__index = Boss
function Boss.new(model: Model)
local self = setmetatable({
model = model,
humanoid = model:FindFirstChildOfClass("Humanoid"),
phase = 1,
attackInterval = 3.0,
}, Boss)
return self
end
function Boss:Start()
while self.humanoid.Health > 0 do
local hpPct = self.humanoid.Health / self.humanoid.MaxHealth
if hpPct < 0.33 and self.phase < 3 then self:EnterPhase(3) end
if hpPct < 0.66 and self.phase < 2 then self:EnterPhase(2) end
AttackPatterns:Random(self.phase, self.model)
task.wait(self.attackInterval)
end
DamageTracker:DistributeLoot(self.model)
end
function Boss:EnterPhase(phase: number)
self.phase = phase
self.attackInterval = 3.0 - (phase - 1) * 0.6
end
return BossBuilding a Roblox boss fight
Boss fights are the most VFX-heavy mechanic Forge AI ships and the easiest place to drop frame rate. The two patterns that decide whether your boss is fun or stuttery: attack telegraphs that respect player reaction time, and pooled VFX that does not Instance.new on every fire.
Forge ships pre-attack telegraphs for every AOE. A red decal appears 1 second before the damage applies, hides, then damage is applied to anyone still inside the radius. This is the same pattern Final Fantasy XIV uses — players have a clear, fair dodge window. The 1-second window is configurable per attack, so faster bosses can use 0.6s.
Pooled VFX matters because Roblox creates a frame stall every time you Instance.new a ParticleEmitter. The Forge AI boss uses a pool of 8 AOE decals and 8 particle emitters, recycled on every attack. With 20 players in the arena and the boss firing 3 attacks per second, the pool keeps the frame budget clean.
Damage tracking is per-player so loot can be ranked. Top damage dealer picks first from the weighted loot table, second-place picks second, etc. This rewards engagement and discourages leech. Configurable: switch to participation-based (anyone who damaged) or pure RNG if your design wants different fairness.
The arena gate closes on first engagement and opens on death or timeout. This prevents the mid-fight escape exploit (player runs out of arena, boss resets HP, player runs back in to free-loot). Closed gates are server-side, no client-trusted state.
See more on the Luau generator, the game builder, or browse the full blog.
Frequently asked
How are phase transitions triggered?+
By boss HP percentage. Phase 2 at 66%, phase 3 at 33%. Each phase swaps attack pattern + reduces interval.
How do attack telegraphs work?+
AOE attacks spawn a red decal ~1 second before the damage applies. The decal hides, then damage is applied to anyone still inside. Players have a clear dodge window.
How is loot distributed?+
Top damage dealer gets first pick from the weighted loot table. Second-place gets second pick. Configurable — can switch to participation-based or pure RNG.
Can I add more phases (4, 5, 6)?+
Yes. AttackPatterns.lua keys patterns by phase number — add pattern 4 and a new HP threshold in BossController. Forge can also regenerate with more phases via a follow-up prompt.
What about boss summoned adds?+
AttackPatterns includes a summon-adds pattern that spawns NPCs from a Models template. Combine with the standard combat system for full mob behaviour.
Related Forge AI prompts
Roblox combat system
5 files · 140 lines · 42 seconds · 1 credit. Drop into your place and press Play.
Roblox leaderboard
4 files · 110 lines · 31 seconds · 1 credit. Cross-server, throttle-safe.
How to prevent exploits in Roblox
4 files · 160 lines · 44 seconds · 1 credit. Drop-in guards + a one-prompt audit of your existing scripts.