Solved Random Player Spawns

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

Jerks

Member
Feb 17, 2019
3
0
1
20
Category: Minigames

What I want:
So I have 4 different arenas with 2 players each. I need to distribute 8 Players in different positions.

When I'd like it by: No given time
 
Do you want a random team distribution or a random location picker?
 
Use
Code:
function randomLocBetween(loc1: location, loc2: location) :: location:
    world of {_loc1} is world of {_loc2}
    set {_x} to random integer between x coord of {_loc1} and x coord of {_loc2}
    set {_z} to random integer between z coord of {_loc1} and z coord of {_loc2}
    set {_loc} to location at {_x}, 0, {_z} of world (world of {_loc1})
    set {_loc} to location of highest solid block at {_loc}
    add 1 to y coord of {_loc}
    return {_loc}