blinking boss bar

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

wrymain

Member
Feb 20, 2025
33
0
6
How do i make it NOT blinking? i tried to only set it(no delete) but it wont work. it was originally
Python:
send action bar
but i want to change it since it can't have 2 lines. and if i try to wait 1 second instead of 10 ticks, it'll skip 2 seconds instead of 1.


Python:
function exptime(p: player):
    if {exptime::%{_p}%} is not set:
        set {exptime::%{_p}%} to 10 seconds
    set {exptime::expire::%{_p}%} to {exptime::%{_p}%} from now
    set {exp::%{_p}%} to true
    while {exp::%{_p}%} is true:
        if "%difference between now and {exptime::expire::%{_p}%}%" contains "second":
            if "%difference between now and {exptime::expire::%{_p}%}%" contains ".":
                set {_s::*} to split "%difference between now and {exptime::expire::%{_p}%}%" at "."
            else:
                set {_s::*} to split "%difference between now and {exptime::expire::%{_p}%}%" at " seconds"
            set {_s2::*} to split {_s::1} at "and "
        if "%difference between now and {exptime::expire::%{_p}%}%" contains "minute":
            set {_m::*} to split "%difference between now and {exptime::expire::%{_p}%}%" at " minute"
        else if "%difference between now and {exptime::expire::%{_p}%}%" contains "minutes":
            set {_m::*} to split "%difference between now and {exptime::expire::%{_p}%}%" at " minutes"
        else:
            delete {_m::1}
        if {_m::1} is not set:
            set {_bar} to boss bar with id "expcount" with title "&8Double Exp Enabled:&4&l %{_s2::1}%s &r&8left"
            add {_p} to {_bar}
            wait 10 ticks
            delete boss bar with id "expcount"
        else:
            if {_s2::2} is set:
                set {_bar} to boss bar with id "expcount" with title "&8Double Exp Enabled:&4&l %{_m::1}%m %{_s2::2}%s &r&8left"
                add {_p} to {_bar}
                wait 10 ticks
                delete boss bar with id "expcount"
            else:
                set {_bar} to boss bar with title "&8Double Exp Enabled:&4&l %{_m::1}%m &r&8left"
                add {_p} to {_bar}
                wait 10 ticks
                delete boss bar with id "expcount"
        wait 1 second
        if {_s::1} = "0":
            delete boss bar with id "expcount"
            delete {exp::%{_p}%}
            delete {exptime::expire::%{_p}%}
            delete {exptime::%{_p}%}
 
try this?
Python:
function exptime(p: player):
    if {exptime::%{_p}%} is not set:
        set {exptime::%{_p}%} to 10 seconds
    set {exptime::expire::%{_p}%} to {exptime::%{_p}%} from now
    set {exp::%{_p}%} to true

    while {exp::%{_p}%} is true:
        set {_remaining} to difference between now and {exptime::expire::%{_p}%}
        set {_s} to seconds of {_remaining}
        set {_m} to minutes of {_remaining}
        
        if {_s} < 0:
            set {_s} to 0
        if {_m} < 0:
            set {_m} to 0

        if {_m} is 0:
            set {_bar} to boss bar with id "expcount" with title "&8Double Exp Enabled:&4&l %{_s}%s &r&8left"
        else:
            set {_bar} to boss bar with id "expcount" with title "&8Double Exp Enabled:&4&l %{_m}%m %{_s}%s &r&8left"

        add {_p} to {_bar}
        wait 10 ticks
        delete boss bar with id "expcount"

        if {_s} <= 0 and {_m} <= 0:
            delete boss bar with id "expcount"
            delete {exp::%{_p}%}
            delete {exptime::expire::%{_p}%}
            delete {exptime::%{_p}%}
            stop

        wait 1 second
 
try this?
Python:
function exptime(p: player):
    if {exptime::%{_p}%} is not set:
        set {exptime::%{_p}%} to 10 seconds
    set {exptime::expire::%{_p}%} to {exptime::%{_p}%} from now
    set {exp::%{_p}%} to true

    while {exp::%{_p}%} is true:
        set {_remaining} to difference between now and {exptime::expire::%{_p}%}
        set {_s} to seconds of {_remaining}
        set {_m} to minutes of {_remaining}
       
        if {_s} < 0:
            set {_s} to 0
        if {_m} < 0:
            set {_m} to 0

        if {_m} is 0:
            set {_bar} to boss bar with id "expcount" with title "&8Double Exp Enabled:&4&l %{_s}%s &r&8left"
        else:
            set {_bar} to boss bar with id "expcount" with title "&8Double Exp Enabled:&4&l %{_m}%m %{_s}%s &r&8left"

        add {_p} to {_bar}
        wait 10 ticks
        delete boss bar with id "expcount"

        if {_s} <= 0 and {_m} <= 0:
            delete boss bar with id "expcount"
            delete {exp::%{_p}%}
            delete {exptime::expire::%{_p}%}
            delete {exptime::%{_p}%}
            stop

        wait 1 second
sorry for not responding for so long i kinda forgot about this, it can't understand the condition in line
Code:
if {_s} <= 0 and {_m} <= 0:
 
oh, what might be your problem is the delete boss bar maybe try setting it to a boss bar without any data? or maybe changing it so then the boss bar isn't deleted and remade quickly