Hi Guys , I have just created a Map Changer system along with a Round system. I wanted to ask how I could link the wait time in the script to show in a gui at the top of the screen , same goes with intermissions , How much time left for a round to end etc.... Here's my script! It works totally fine :
local players = game.Players:GetChildren()
local maps = game.Lighting.Maps:GetChildren()
local currentmap = game.Workspace:WaitForChild("CurrentMap")
local chosenmap = script:WaitForChild("ChosenMap")
local spawner = game.Workspace:WaitForChild("Spawn")
local choices = {}
function choosemap()
for i = 1,#maps do
if maps[i]:isA("Model")then
table.insert(choices,maps[i])
end
end
local picked = math.random(1,#maps)
chosenmap.Value = choices[picked].Name
end
--Load the map
function loadMap()
local map = game.Lighting.Maps:FindFirstChild(chosenmap.Value)
if map then
local mapclone = map:Clone()
mapclone.Parent = currentmap
mapclone:SetPrimaryPartCFrame(CFrame.new(0,0,0))
end
end
function deleteMap()
for i,v in pairs(currentmap:GetChildren())do
if v:isA("Model") then
v:Destroy()
end
end
end
function teleportPlayers()
for i,v in pairs(game.Players:GetChildren())do
v.Character.HumanoidRootPart.CFrame = currentmap:FindFirstChild(chosenmap.Value).Spawn.CFrame * CFrame.new(math.random(5,10),0,math.random(5,10))
end
end
function teleportBack()
for i,v in pairs(game.Players:GetChildren())do
v.Character.HumanoidRootPart.CFrame = spawner.SpawnLocation.CFrame * CFrame.new(math.random(5,10),0,math.random(5,10))
end
end
while true do
wait(3)
choosemap()
loadMap()
wait(1)
teleportPlayers()
wait(10)
deleteMap()
teleportBack()
end

2 comments
Changed not changed. how do you make errors
I thought it might be that, I am not typing in studio and this website doesn't make autocorrect coding.