I need a script that teleports players to a random place in a universe. I'm creating an FPS with a lobby and I want it to teleport to a random place in that universe. How do I do this?
Create a table of placeid
s and then use the math.random()
random number generator to choose one of them from the table randomly:
places = {1818, 1457, 16745} --Fill this table with the id's for the different places chosenPlace = places[math.random(1,#places)] --Assuming this is in a LocalScript game:GetService('TeleportService'):Teleport(chosenPlace)