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 set variable to %player count%

Discussion in 'Skript' started by Brok3nmind, Jan 26, 2019.

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

    Brok3nmind Active Member

    Joined:
    Feb 3, 2017
    Messages:
    66
    Likes Received:
    1
  2. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    243
    Likes Received:
    21
    Code (Text):
    1. command /math:
    2.     trigger:
    3.         set {_count} to 0
    4.         loop all players:
    5.             add 1 to {_count}
    6.         broadcast "%{_count}%"
    You can also try this without loop:

    Code (Text):
    1. command /math:
    2.     trigger:
    3.         set {_count} to size of all players
    4.         broadcast "%{_count}%"
    The loop one should work on all versions, I'm not sure if the non loop one will work on all versions. It seems to work for me on skript 2.3.2.
     
    #2 AsuDev, Jan 26, 2019
    Last edited: Jan 26, 2019
    • Like Like x 1
  3. Brok3nmind

    Brok3nmind Active Member

    Joined:
    Feb 3, 2017
    Messages:
    66
    Likes Received:
    1
    Thanks
     
Thread Status:
Not open for further replies.

Share This Page

Loading...