Need help making a Boss Battle

So, I been working on this game Crown Over™ [Abandoned ] - Roblox
And I already finished the prologue, I am working on chapter 1. Basically, all I need is help with creating a Boss Fight by using a humanoid/dummy.


And, maybe a model will help and for the most of us too. Seriously I tried to search this topic but there was no results.

4 Likes

What you could do is assign moves as functions, have those functions in a loop.
Have it randomly call the functions, if you want to make stages, add the moves in those stages and call them when it reaches the right health.

Once the boss reaches 0, detect it. Then reward the player for beating the boss or however you would like to do it.

4 Likes

The only part I could do is

but not the others… I am sorry but I don’t know the script for that. You are very specific, but not that specific a script would be helpful until… I find a script for that before you do.

This isn’t a place to ask for scripts, use the developer hub to learn about functions, math.random and loops.

I literally did not know that there was a developer hub. Welp, I will mark your reply as solution when I get to figure this out.

https://developer.roblox.com/en-us

1 Like

Creating a moveset list would be as simple as creating a table and going through it. Going into depth is all up to you though.

local Powers = {
    {
        Cooldown = 5,
        Function = function()
            -- Something?
        end
    }
}

Cooldown represents how long an attack should wait, plus a given default interval, between each move set. It can also represent another value based on your liking. You can even not include that at all and just include a table of functions. Then, just select one randomly in a loop pattern.

local TimeBetweenPowers = 5

-- EnemyDefeated represents Humanoid.Health > 0
-- Iterations do not start if condition isn't met
while not (EnemyDefeated) do
    local move = Powers[math.random(1, #Powers)]
    move.Function() -- or move() if table of function values
    -- We repeat condition above but in an if statement
    -- This prevents waiting if the enemy isn't alive
    if not EnemyDefeated then
        wait(TimeBetweenPowers + move.Cooldown)
    end
end

-- Enemy defeated code here, despawn humanoid by destroying parent
-- ^ Last part of above would only work if script is under NPC itself

script.Parent:Destroy() -- Despawn boss

Play around with code some, you’ll find something you like eventually.

12 Likes