ActionBar

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

BirdCanFly

Member
Jun 22, 2017
29
2
3
code_language.skript:
loop all players:
    set action bar of loop-player to " &8[&2WastedOrcLands&8] &c<> &8[&35 minuten&8]"
    wait 1 seconds
    set action bar of loop-player to " &8[&2WastedOrcLands&8] &c<> &8[&34:59 minuten&8]"
Hello, i want to show the whole server a timer with ActionBar at the same time.
But it first shows the ActionBar to one player, then another one, then another one etc.
How can i fix that?
 
That's because you put the 1second in the loop.
So, the messages are send to everyone with a delay of 1s

You can test that out using:
code_language.skript:
loop all players:
    set action bar of loop-player to " &8[&2WastedOrcLands&8] &c<> &8[&35 minuten&8]"
You will see that all the players get the same message in the same time.
 
That is just an example to make a cooldown system for minigame or something else:
code_language.skript:
set {_cooldown} to 60
while {_cooldown} is more than 0:
    loop all players:
        message "This is just an example: %{_cooldown}%" to loop-player
    remove 1 from {_cooldown}
    wait 1 second

Instead of that , if you want that everyone see the message , just use the broadcast effect one and not the message.
code_language.skript:
set {_cooldown} to 60
while {_cooldown} is more than 0:
    broadcast "This is just an example: %{_cooldown}%"
    remove 1 from {_cooldown}
    wait 1 second
 
Yes, use the same code that @YoshYz has posted, and replace the message with the actionbar syntax.
code_language.skript:
set {_cooldown} to 60
while {_cooldown} is more than 0:
    show an actionbar from "&7A cooldown: %{_cooldown}%" to loop-player
    remove 1 from {_cooldown}
    wait 1 second
 
Wait wait, you need something as this?:

code_language.skript:
on join:
    loop all players:
        while loop-player is online:
            set action bar of loop-value to "text 1"
            wait 5 tick
            set action bar of loop-value to "text 2"
 
Status
Not open for further replies.