Selecting A Random 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 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!

IViddyy

Member
Apr 17, 2022
17
1
3
Hi im trying to make a command that when used selects a random player and calls them a nerd (example: [player] is a nerd!!!) but i dont know how to.I made a command that kinda works but idk how to send the name of the player.Here is the code i have currently

Code:
command /nerd:
    trigger:
        loop all players:
            add all players to {_players::*}
            set {_size} to size of {_players::*}
            set {_x} to a random integer between 1 and {_size}
            send "&e&l%{_players::{_x}}% &6&lis a nerd!!!"
 
try
Code:
command /nerd:
    trigger:
        loop all players:
            add all players to {_players::*}
            set {_x} to a random element out of {_players::*}
        broadcast "%{_x}% is a nerd!"
 
Code:
command /nerd:
  trigger:
    set {_player} to random element of (all players)
    send "%name of {_player}%'S A NERD!" to all players