How to add a bossbar

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Hello, you need to create a bossbar with an id for all the players like this:
Code:
command /spawnboss:
    trigger:
        spawn giant at player's location
        set {_b} to last spawned entity
        set {_h} to {_b}'s health
        while {_b} is alive:
            set {_remainingh} to {_b}'s health
            set {_progress} to {_remainingh} / {_h} * 100
            create bossbar titled "Boss" and id "Boss" for all players with progress {_progress}
            wait 1 second
            remove bossbar "Boss"
Btw I don't know if you wanted to make it so that the bossbar displays the boss's health too or not so I added that anyways, if you don't want it to display the boss's health on the bossbar just remove line 5,7,8 and the "with progress {_progress}" part.
command /spawnboss:
trigger:
spawn giant at player's location

how do i give this a bossbar?
 
Status
Not open for further replies.