Assigning a number to an amount of players

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

DerpoDrago

Member
Jan 15, 2020
10
0
0
22
So I've been trying to make a skript where it gets half of the players online and rounds down if its not an integer, but I can't figure out the part where I assign a number to every player and randomly pick half of them out. Any help would be appreciated.
I'm on version 2.4 if that helps.
Code:
on left click with golden carrot:
    if player has permission "worldedit.navigation.up":
        set {n} to false
    if {n} is true:
        cancel event
    else:
        set {a} to player's held item
        set {n} to true
        if {a}'s name is "&4&nT&6&nh&e&na&a&nn&2&no&b&ns&3&n' &1&n&lI&d&n&ln&5&n&lf&9&n&li&f&n&ln&7&n&li&8&n&lt&0&n&ly &1&n&lG&2&n&la&3&n&lu&4&n&ln&5&n&lt&6&n&ll&7&n&le&8&n&lt":
            broadcast "&d&lPerfectly balanced"
            wait 10 seconds
            set player's health to 1
            set {s} to number of all players
            set {mo} to ({s} / 2)
            if {mo} is not an integer:
                add 00 to {mo}
            else:
                add -0.5 to {mo}
            broadcast "&d&las all things should be"
[doublepost=1580082219,1579984492][/doublepost]Thanks a lot, it worked
 
Status
Not open for further replies.