Selecting 1 loop-player that is in a certain gamemode

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

iNuclearTNT

My community needs this game so I'm in a rush to be checking this thread every hour. Help please and any donate knowledge if you can.
I'm making a game that requires selecting a random looped player in survival in a certain world.
I messed around with the code given to me a while ago .-. nothing worked

set {system.selectedplayer} to random element out of loop players in world "BoomTag1"

set {system.selectedplayer} to random single player out of loop players in world "BoomTag1"


To help picture what I'm requesting here, one player in survival (playing) gets chosen as IT and can tag someone else, I got the code for tagging other people down, I'm just struggling here. Because spectators are allowed in the same world (in gm3) and I love the code so far so please don't tell me there isn't a way. I'll even learn how to create skript addons if i must, I'm also new to the forums, hellu!
 
You wouldn't want the word 'loop' in there since that's used to iterate over a list, which you're not doing. Something like this should work fine though:
code_language.skript:
set {system.selectedplayer} to random element out of (players in world "BoomTag1")
The parentheses are unnecessary but I like to add them in situations like this for clarity since it helps show the separation of the list which you're selecting an element from.
 
Status
Not open for further replies.