Solved Teleport many players around a location

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

Aberforth

Member
Jun 14, 2019
40
2
8
Canada
Hello,

How can I teleport all the players on the server to random blocks in a specific radius from a location?
I tried a few times and looked at the docs but couldn't find an answer.
 
Use this code:
Code:
loop blocks in radius %your integer radius% around %your location%:
    add location of loop-block to {_blocks::*}
set {_b} to random element of {_blocks::*}

Code:
set {_loc} to location at 3, 15, 69 in world "world"
loop blocks in radius 3 around {_loc}:
    add location of loop-block to {_blocks::*}
loop all players:
    set {_b} to random element of {_blocks::*}
    teleport loop-player to {_b}
 
  • Like
Reactions: Aberforth
However, this will teleport all the players to one random block in the radius. I was trying to have each player teleported to a random block in that radius, so in the end the players would be scattered around the location.
 
However, this will teleport all the players to one random block in the radius. I was trying to have each player teleported to a random block in that radius, so in the end the players would be scattered around the location.
Nope. Have you read the example? The random block is picked for each person individually.
 
  • Like
Reactions: Aberforth
Status
Not open for further replies.