local choices = {"a", "b", "c", "d", "e", "f"} local map = choices[math.random(1,#choices)] local rtarget = game.Workspace.RedTargetPosition local btarget = game.Workspace.BlueTargetPosition local target2 = game.Workspace.LobbyPosition while true do local m = Instance.new("Message", game.Workspace) m.Text = "There are 10 minute rounds, a random map will be selected." wait(1) m.Text = "Once the map is selected, players are sent to it." wait(1) m.Text = "Fight for the 10 minute round, then leave." wait(1) for i = 5,1,-1 do wait(1) m.Text = "Selecting a map in" ..i end map.Parent = Workspace map:MakeJoints() m.Text = map.. "has been chosen!" wait(3) for i,v in pairs (game.Players:GetPlayers()) do if v ~= nil and v.TeamColor.Name == "Bright red" then v.Character.Torso.CFrame = rtarget.CFrame*(0) elseif v ~= nil and v.TeamColor.Name == "Bright blue" then v.Character.Torso.CFrame = btarget.CFrame*(0) end wait(.1) end print("Players teleported onto map") wait(600) --10 minutes for i,z in pairs (game.Players:GetPlayers()) do if z ~= nil then z.Character.Torso.CFrame = target2.CFrame*(0) end end end
Heres the code I fixed
local choices = {"a", "b", "c", "d", "e", "f"} local map = choices[math.random(1,#choices)] local rtarget = game.Workspace.RedTargetPosition local btarget = game.Workspace.BlueTargetPosition local target2 = game.Workspace.LobbyPosition while true do local m = Instance.new("Message", game.Workspace) m.Text = "There are 10 minute rounds, a random map will be selected." wait(1) m.Text = "Once the map is selected, players are sent to it." wait(1) m.Text = "Fight for the 10 minute round, then leave." wait(1) for i = 5,1,1 do wait(1) m.Text = "Selecting a map in" ..i end map.Parent = Workspace map:MakeJoints() m.Text = map.. "has been chosen!" wait(3) for i,v in ipairs (game.Players:GetPlayers()) do if v ~= nil and v.TeamColor.Name == "Bright red" then v.Character.Torso.CFrame = rtarget.CFrame*(0) elseif v ~= nil and v.TeamColor.Name == "Bright blue" then v.Character.Torso.CFrame = btarget.CFrame*(0) end wait(.1) end print("Players teleported onto map") wait(600) --10 minutes for i,z in ipairs (game.Players:GetPlayers()) do if z ~= nil then z.Character.Torso.CFrame = target2.CFrame*(0) end end end