Script is not teleporting players
local replicatedstorage = game:GetService('ReplicatedStorage')
local status = replicatedstorage:WaitForChild('InfoValue')
local mapstorage = game.Workspace:WaitForChild('mapStorage')
while true do
while game.Players.NumPlayers > 2 do
status.Value = 'There needs to be 2 or more players to begin'
repeat wait(2) until game.Players.NumPlayers >= 2
end
for i = 25,0,-1 do
status.Value = 'Intermission '..i
wait(1)
end
local mapsinserverstorage = game:GetService('ServerStorage'):GetChildren()
local chosenmap = mapsinserverstorage[math.random(1, #mapsinserverstorage)]
ch######################## game.Workspace
status.Value = 'Game Starting'
wait(3)
local spawns = chosenmap:WaitForChild('Spawns'):GetChildren()
for _, player in pairs(game.Players:GetPlayers()) do
if player and #spawns > 0 then
local torso = player.Character:WaitForChild('HumanoidRootPart')
local allspawns = math.random(1, #spawns)
local randomspawn = spawns [allspawns]
if randomspawn and torso then
table.remove(spawns, allspawns)
torso.CFrame = CFrame.new(randomspawn.Position + Vector3.new(0,2,0))
end
end
end
|