Hey, so I made this system where every 300 seconds the map changes but my timer ain’t working?
GameState = script.Gamestate
Text = game.StarterGui.Round.TextLabel
while true do
GameState.Value = "Classic"
Map1Clone = game.ReplicatedStorage.Maps.Map1:Clone()
Map1Clone.Parent = game.Workspace
for i = 300, 0, -1 do
Text.Text = i
wait(1)
end
Map1Clone:Destroy()
----------------------------------------------------------------
GameState.Value = "City"
Map2Clone = game.ReplicatedStorage.Maps.Map2:Clone()
Map2Clone.Parent = game.Workspace
for i = 300, 0, -1 do
Text.Text = i
wait(1)
end
Map2Clone:Destroy()
----------------------------------------------------------------
GameState.Value = "Desert"
Map3Clone = game.ReplicatedStorage.Maps.Map3:Clone()
Map3Clone.Parent = game.Workspace
for i = 300, 0, -1 do
Text.Text = i
wait(1)
end
Map3Clone:Destroy()
end
Whenever I test the script the countdown stops and 299 or 298 and doesn’t go further
You’re changing StarterGui. Have a NumberValue (preferably somewhere in ReplicatedStorage), have the server change that instead of the text in StarterGui, have the client detect changes in that, and change the text in the PlayerGui.
I changed the script and added another script in the screenGui but the Timer Value doesn’t seem to change it just stays on 0
GameState = script.Gamestate
Timer = script.Timer
while wait() do
GameState.Value = "Classic"
Map1Clone = game.ReplicatedStorage.Maps.Map1:Clone()
Map1Clone.Parent = game.Workspace
for i = 300, 0, -1 do
Timer.Value = i
wait(1)
end
Map1Clone:Destroy()
----------------------------------------------------------------
GameState.Value = "City"
Map2Clone = game.ReplicatedStorage.Maps.Map2:Clone()
Map2Clone.Parent = game.Workspace
for i = 300, 0, -1 do
Timer.Value = i
wait(1)
end
Map2Clone:Destroy()
----------------------------------------------------------------
GameState.Value = "Desert"
Map3Clone = game.ReplicatedStorage.Maps.Map3:Clone()
Map3Clone.Parent = game.Workspace
for i = 300, 0, -1 do
Timer.Value = i
wait(1)
end
Map3Clone:Destroy()
end
Timer = game.ReplicatedStorage:WaitForChild("GameSystem"):WaitForChild("Timer")
local player = game.Players.LocalPlayer
local Text = player.PlayerGui.Round.TextLabel
while true do
Text.Text = Timer.Value
wait(0.1)
end