Solved Title for every player

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

    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.

Hobbit41

Member
Jun 15, 2017
32
0
0
Hey guys, im trying to make simple countdown on Titles. Obvious problem is that this countdown every time is showing itself for 1st player, then for 2nd etc... That means that countdown would take as much time as there are players.
Is there any way to make proper Title sending, e.g. for every players at one moment without loop?
code_language.skript:
loop all players:
                    set {time} to 3
                    send loop-player title "&9%{time}%" for 1 second
                    remove 1 from {time}
                    wait 1 second
                    send loop-player title "&9%{time}%" for 1 second
                    remove 1 from {time}
                    wait 1 second
                    send loop-player title "&9%{time}%" for 1 second
                    remove 1 from {time}
                    wait 1 second
 
Alright, so because you have the main code block within the player loop, it runs the entire thing for each player individually. Meaning, by the time player1 is done, player2 starts.

We need a way to loop all players, and then modify the variable, to have it loop all players again. Something like this should work:

code_language.skript:
# using a local variable
    set {_time} to 3
    # while our variable is >= 0; since we're subtracting, and we want 0 to appear
    while {_time} is greater than or equal to 0:
        loop all players:
            send loop-player title "&9%{_time}%" for 1 second
        wait 1 second
        subtract 1 from {_time}
 
Status
Not open for further replies.