Look i have some errors, i followed a yt vid how to do it but idk how t ofix it now, can someone help me? Look at the script i send image too. It should start a round and teleport to the game mode but it doesn’t
– Variables
local Lobby = game.Workspace.Lobby
local Maps = game.ReplicatedStorage.Maps:GetChildren()
local Status = game.ReplicatedStorage.Status
– Game Loop
while true do
-- Intermission
for i = 10, 0, -1 do
Status.Value = "Intermissions: "..i
task.wait(1)
end
-- Map Selector
local ChosenMap = Maps[math.random(1, #Maps)]
local ClonedMap = ChosenMap:Clone()
ClonedMap.Parent = game.Workspace
Status.Value ="Map: "..ClonedMap.Name
task.wait(3)
-- Teleports to map
for i, Players in pairs(game.Players:GetPlayers()) do
local Character = Player.Character
if Character then
local HumanoidRootPart = Character.HumanoidRootPart
HumanoidRootPart.CFrame = ClonedMap.TeleportPoint.CFrame
end
end
-- Game Time
for i = 10,0,-1 do
Status.Value = "Game: "..i
task.wait(1)
end
end
-- Teleports to Lobby
for i, Player in pairs(game.Players:GetPlayers()) do
local Character = Player.Character
if Character then
local HumanoidRootPart = Character.HumanoidRootPart
HumanoidRootPart.CFrame = Lobby.TeleportPoint.CFrame
end
end
-- Destroys Map
ClonedMap: Destroy()
Here I assume you meant for i, Player in pairs
The character you are grabbing is from the variable player while you’re looping over a variable named Players plural
local Lobby = game.Workspace.Lobby
local Maps = game.ReplicatedStorage.Maps:GetChildren()
local Status = game.ReplicatedStorage.Status
while true do
-- Intermission
for i = 10, 0, -1 do
Status.Value = "Intermissions: "..i
task.wait(1)
end
-- Map Selector
local ChosenMap = Maps[math.random(1, #Maps)]
local ClonedMap = ChosenMap:Clone()
ClonedMap.Parent = workspace
Status.Value ="Map: ".. ClonedMap.Name
task.wait(3)
-- Teleports to map
for i, Player in pairs(game.Players:GetPlayers()) do
local Character = Player.Character
if Character then
Character:PivotTo(ClonedMap.TeleportPoint.CFrame)
end
end
-- Game Time
for i = 10,0,-1 do
Status.Value = "Game: "..i
task.wait(1)
end
-- Teleports to Lobby
for i, Player in pairs(game.Players:GetPlayers()) do
local Character = Player.Character
if Character then
Character:PivotTo(Lobby.TeleportPoint.CFrame)
end
end
-- Destroys Map
ClonedMap:Destroy()
end