Multiple spawn points

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

Jul 18, 2023
27
0
1
16
Hi there! I'm trying to make a zombie apocalypse server and I want players to be spread around the map when they first join. I've tried integers and those aren't working. If anyone could help me out, that'd be great. Thank you! :emoji_grin:
 
Last edited:
You can add them to a list variable and when they start teleport everyone to a random element from the list variable. Do you need an example?
 
Oh, by the way, I want a singular player only when they first join (or die) to be tpd to a random location on the map
 
Code:
command addspawn:
    permission: *
    trigger:
        add sender's location to {spawnlocs::*}
        send "&cLocation added!"
        
command resetspawns:
    permission: *
    trigger:
        delete {spawnlocs::*}
        send "&cLocations reset."

This is how you can add and reset the locations, from there you can use the
random element from
syntax to get a random location from the list of them, whenever they join or respawn, and tp them there.