I know this site isnt really for helping , but I have a specific question that can't be awnsered by a turtorial on Youtube. Im making a pick a door game, and it involves a attacker that needs to spawn in 1 of 3 spawn points each round. I cant find this in a tutorial, please awnser my question as soon as possible.
COMMUNITY QUESTION
How to make a random spawn point of of 3 for a attacker?
1 answer
Group your spawnpoints inside a folder ( preferably ).
Then use math.random()
Example script:
local Spawns = -- define your spawnpoints folder
local Players = game.Players:GetPlayers()
local chosenSpawn = math.random(#Spawns)
local chosenPlayer = math.random(#Players)
local char = Players[chosenPlayer].Character
char.HumanoidRootPart.CFrame = Spawns[chosenSpawn].CFrame
table.remove(Spawns, chosenSpawn) -- to prevent people spawning in the same spawn
table.remove(Players, chosenPlayer)
This is just an example, run this in a function or loop or whatever you are planning to do with it.
This discussion is preserved as it was. New answers, comments, and votes are closed.
