Set a variable of a random player to true

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

moritzMSN

Member
Nov 22, 2018
3
0
1
I dont know how i can do that

Code:
on join:
    set {bed.%player%} to true
    set {team.attacker.%player%} to false
    set player's gamemode to survival
    heal player
    set hunger to 20
    clear player's inventory
    add 1 to {slots}
    wait 1 tick
    teleport player to {lobby}
    if {slots} is 1:
        set {team.attacker.%player%} to true
    else:
        loop all players:
            if {team.attacker.%loop-player%} is false:
                add 1 to {_size}
                if {_size} is 2:
                    add loop-player to {_players::*}
                    set {_size} to size of {_players::*}
                    set {_x} to a random integer between 1 and {_size}
                    set {team.attacker.%{_x}%} to true
 
Code:
set {_player} to random player out of all players
set {team.attacker.%{_player}%} to true
This?
 
Status
Not open for further replies.