In my minimap's there are 25 spawns. My problem is that there's a 1 in 25 chance of someone being spawned in the same place, and I'm trying to prevent this. How do I prevent no two people from spawning at the same spawn? Thank you!
function MovePlayers()
local Players = game.Players:GetPlayers()
local Spawnso = game.Workspace.Map.Spawns:GetChildren()
for i, v in pairs(Players) do
local ToSpawn = math.random(1, #Spawnso)
if v.GameBool.Value == true then
v.Character.HumanoidRootPart.CFrame = Spawnso[ToSpawn].CFrame * CFrame.new(0,5,0)
v.Ingame.Value = true
-- the last part is probably not needed but oh well
wait(0.05)
v.Character.Torso.Anchored = true
end
end
end

3 comments
How do I place it inside a table?
table.insert(TABLE table, ANY, NUMBER Position)
How do i make an if statement or function of when a player spawns at a point?