Teleporting players in studio it works, this doesn't work in the actual game though.

MainGui is in StarterGui

Players teleport about 20 seconds after spawning in, which is the code that is ran below.

Any questions just leave a comment. Thanks!

Error log:

imgur.com/DSTpSAz

Code:

function teleportPlayers()
		
	playersT = game.Players:GetChildren()
	spawns = map.Spawns:GetChildren()
		
	numPlayers = game.Players.NumPlayers
	
	game.Workspace.ServerStats.FuelAmount.MaxValue = numPlayers*3		
		
	for i = 1,#playersT do
		
		randSpawn = spawns[math.floor(math.random(1,#spawns))]	
		
		playersT[i].Character.Torso.CFrame = CFrame.new(randSpawn.CFrame.X,randSpawn.CFrame.Y+3,randSpawn.CFrame.Z)
			
		randSpawn:Destroy()			
			
		playersT[i].PlayerGui.MainGui.Alive.Value = true	-- says that MainGui is not valid but it is
				
	end
	
end