1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Trying to make a bossbar for a mob in SkBee

Discussion in 'Skript' started by RaineFS, Jan 12, 2023.

Thread Status:
Not open for further replies.
  1. RaineFS

    RaineFS Member

    Joined:
    Jan 12, 2023
    Messages:
    1
    Likes Received:
    0
    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 (Text):
    1. command /blazetest:
    2.     trigger:
    3.         spawn blaze at location 1000.500, 160, 1000.500
    4.         set last spawned blaze's max health to 100
    5.         set last spawned blaze's health to 100
    6.         set display name of last spawned blaze to "§7[Lvl 200] §c§lPyroclastic Blaze"
    7.         set {_blaze} to last spawned blaze
    8.         set {_blazeBar} to bossbar named "blazeBossbar" with title "§c§lPyroclastic Blaze" with color bar red with style segmented 6
    9.         loop all players:
    10.             if distance between player and {_blaze} is less than 50:
    11.                 add player to bossbar players of {_blazeBar}
    12.                
    13. on damage:
    14.     if victim is a {_blaze}:
    15.         set bossbar progress of {_blazeBar} to health of victim
    16.  
    17.    
    18. on death:
    19.     if victim is {_blaze}:
    20.         set bossbar visibility of {_blazeBar} to false
    --- Double Post Merged, Jan 12, 2023, Original Post Date: Jan 12, 2023 ---
    Solved my problem, i was using local variables
     
Thread Status:
Not open for further replies.

Share This Page

Loading...