Solved Is it possible to get the amount of players online in a multiverse world in scoreboard?

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

bayler

Member
Dec 18, 2017
11
0
0
24
Is it possible to get the amount of players online in a multiverse world in scoreboard like hub scoreboard?
 
You can loop all players than check loop player world. If player is in your world, then you add number 1 to custom variable.
 
Something like: Loop all players in world "world", then pick loop-value in scoreboard.


code_language.skript:
on join:
  wipe player's sidebar
  set name of sidebar of player to "Name"
  set score "Factions" in sidebar of player to -1
  loop all players in world "factions":
    add loop-value to {_factions}
    set score "%{_factions}%" in sidebar of loop-player to -2

#!Or something like this
 
Without looping:
code_language.skript:
size of all players in world "factions"
 
Status
Not open for further replies.