function startGame(map) gameRunning = 1 Spawns = map.Spawns.Humans:GetChildren() alienSpawns = map.Spawns.Aliens:GetChildren() -- assuming I make these models players = game.Players:GetPlayers() randomPlayers() checkPlayers() print("startingGame") medSpawnNum = math.random(1,#Spawns) for _,v in pairs (players) do if _ == Aliennum then print(v.Name) table.insert(Aliens,v) table.insert(_G.AliensAlive,v) elseif _ == Aliennum2 then table.insert(Aliens,v) table.insert(_G.AliensAlive,v) elseif _ == Medicnum then Medic = v table.insert(_G.playersAlive,v) else table.insert(Humans,v) table.insert(_G.playersAlive,v) end end for c,d in pairs (Humans) do spawnNum = math.random(1,#Spawns) pos = Spawns[spawnNum].Position coroutine.wrap (function() d.CharacterAdded:wait():MoveTo(pos + Vector3.new(0,3,0)) end)() makeHuman(d) -- add GUI and weapons here and other stuff needed end if Medic then coroutine.wrap (function() Medic.CharacterAdded:wait():MoveTo(pos + Vector3.new(0,3,0)) end)() end for e,f in pairs (Aliens) do alienSpawnNum = math.random(1,#Spawns) -- this whole loop is kinda not needed coroutine.wrap (function() f.CharacterAdded:wait():MoveTo(aliensSpawns[alienSpawnNum].Poisition + Vector3.new(0,3,0)) end)() makeAlien(f) -- add GUI here and weapons end Start() end