So, this script is a Normal Script inside of ServerScriptService and it will not change the text of the text label inside of Timer.
Script:
local maps = {}
local Player = {}
game.Players.PlayerAdded:Connect(function(plr)
table.insert(Player,plr.Name)
end)
for i,v in pairs(game.ReplicatedStorage.Maps:GetChildren()) do
if v:IsA("Model") then
table.insert(maps,v.Name)
table.sort(maps)
end
end
while true do
wait()
for i,v in pairs(game.Players:GetChildren()) do
if i >= 1 then
for timee = 30, 0, -1 do
wait(1)
for i,v in pairs(Player) do
game.Players[v].PlayerGui.Timer.TextLabel.Text = "Game Starting In "..timee.." Seconds..."
end
if timee == 0 then
for i,v in pairs(Player) do
game.Players[v].PlayerGui.Timer.TextLabel.Text = "Teleporting Players..."
wait(0.5)
end
end
end
local PickedMap = maps[math.random(1,#maps)]
local CloneMap = game.ReplicatedStorage.Maps[PickedMap]:Clone()
CloneMap.Parent = game.Workspace
for i,plr in pairs(Player) do
for i,map in pairs(CloneMap:GetChildren()) do
if map.Name == "Spawn" then
game.Workspace[plr]:SetPrimaryPartCFrame(map.CFrame)
end
end
end
for t = 120, 0, -1 do
wait(1)
for i,v in pairs(Player) do
game.Players[v].PlayerGui.Timer.TextLabel.Text = "Game Ends In "..t.." Seconds..."
end
if t == 0 then
game.Workspace[PickedMap]:Destroy()
wait(1)
end
end
end
end
end
Thank You For Your Help!
