My issue here is it won't change the time like follow it and I'm not sure why FE is enabled but like the gametime wont change it stay as the default. this is in a serverscript in server script service?

while true do
	if game.Players.NumPlayers >=1 then
		local winner = game.Workspace.Winner
		local stats = game.ReplicatedStorage.Stats:FindFirstChildOfClass("Folder")
		local maps = game.ReplicatedStorage.Maps:GetChildren()
		local ran = math.random(1,#maps)
		local map = maps[ran]
		local chosenmap = map:Clone()
		local timeleft = game.ReplicatedStorage.TimeLeft
		local Sound = Instance.new("Sound")
		Sound.Name = "Countdown"
		Sound.MaxDistance = 1000000000.000
		Sound.Volume = 1.5
		Sound.SoundId = "rbxassetid://209744571"
		Sound.Parent = game.Workspace
		chosenmap.Parent = game.Workspace
		
		for i,plr in pairs (game.Players:GetPlayers()) do
			local current = plr.PlayerGui:WaitForChild("GameTime").Frame.Current
			local Time =   plr.PlayerGui:WaitForChild("GameTime").Frame.Time
			for x = 5,0,-1 do
				timeleft.Value = 0
				timeleft.Value = x
				plr.Alive.Value = true
				Time.Text = timeleft.Value
				stats.Name = "Map Chosen: "..chosenmap.Name
				current.Text = stats.Name
			wait(1)
		end		
		for i = 15, 0, -1 do
			timeleft.Value = 0
			timeleft.Value = i
			stats.Name = "Intermission: "
			current.Text = stats.Name
			Time.Text = timeleft.Value 
			if i == 5 then
				Sound:Play()
			end
			if i == 0 then
				for i, Spawn in pairs(chosenmap.Spawns:GetChildren()) do
					plr.Character.Torso.CFrame = Spawn.CFrame * CFrame.new(0,2,0)
				end
			end
			wait(1)
		end
		local tool = game.ReplicatedStorage.Swords.Sword
		local toolc = tool:Clone()
		toolc.Parent = plr.Backpack
		for n = 10,0,-1 do
			timeleft.Value = 0
			timeleft.Value = n
			stats.Name = "Game Time: "
			current.Text = stats.Name
			Time.Text = timeleft.Value 
			if i == 0 then
				stats.Name = "Game Over!"
				current.Text = stats.Name
				Time.Text = "0"
				for i,alive in pairs(game.Players:GetPlayers()) do
					for i, moveback in pairs(game.Workspace.Spawns:GetChildren()) do
						alive.CFrame = moveback.CFrame * CFrame.new(0,2,0)
					end
				end
			end
			wait(1)
		end
	end
	end
	wait(.1)
end

1 comment

0

Short answer is that you're trying to do GUI manipulation on the server. That code must go on the client side (using LocalScripts). See the Guides at the top of this site, specifically https://scriptinghelpers.org/guides/server-client-relationship-in-roblox