Solved Trying to make a bossbar for a mob in SkBee

  • 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.

RaineFS

Member
Jan 12, 2023
1
0
1
37
I am making a boss fight that uses a blaze mob. When i run the command it creates a bossbar, but it does not update the bossbar with the health of the mob and does not make the bossbar invisible when the mob dies.

Code:
command /blazetest:
    trigger:
        spawn blaze at location 1000.500, 160, 1000.500
        set last spawned blaze's max health to 100
        set last spawned blaze's health to 100
        set display name of last spawned blaze to "§7[Lvl 200] §c§lPyroclastic Blaze"
        set {_blaze} to last spawned blaze
        set {_blazeBar} to bossbar named "blazeBossbar" with title "§c§lPyroclastic Blaze" with color bar red with style segmented 6
        loop all players:
            if distance between player and {_blaze} is less than 50:
                add player to bossbar players of {_blazeBar}
                
on damage:
    if victim is a {_blaze}:
        set bossbar progress of {_blazeBar} to health of victim

    
on death:
    if victim is {_blaze}:
        set bossbar visibility of {_blazeBar} to false
[doublepost=1673536473,1673522982][/doublepost]Solved my problem, i was using local variables
 
Status
Not open for further replies.