Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[Solved]Why is my round system template not working? What am I doing wrong?

I was just making a round system for a template, but something is very wrong.

Client:

local StarterGui = game:GetService("StarterGui")
local RoundGui = StarterGui:WaitForChild("RoundGui")
local Timer = RoundGui:WaitForChild("Timer")
local RoundInfo = RoundGui:WaitForChild("RoundInfo")

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
local StartTimerEvent = Remotes:WaitForChild("StartTimer")

function StartTimer(eventName, timeToCount)
	print("ClientWorking")
	RoundInfo.Text = eventName
	for i = timeToCount, 0, -1 do
		--OldScript: print("ForLoopWorking")
		print("ForLoopWorking: "..i) --NewScript 
		wait(1)
		Timer.Text = tostring(i)
	end
end

StartTimerEvent.OnClientEvent:Connect(StartTimer)

Server:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
local StartTimerEvent = Remotes:WaitForChild("StartTimer")

local Configuration = script:WaitForChild("Config")
local Enabled = Configuration:WaitForChild("Enabled").Value
local IntermissionTime = Configuration:WaitForChild("IntermissionTime").Value
local RoundTime = Configuration:WaitForChild("RoundTime").Value

function StartRound()
	StartTimerEvent:FireAllClients("Intermission", IntermissionTime)
	wait(IntermissionTime)
	StartTimerEvent:FireAllClients("Round", RoundTime)
	wait(RoundTime)
end

if Enabled then
	wait(8)
	print("ServerWorking")
	StartRound()
end


Everything printed, The remotes fired, but none of the gui changed text, and I can't figure out what is making it fail.

My resources are all in their respective folders and my configs are set to valid values. Edit: What is even stranger is that the timer actually counts down if I add "i" to the print values.

1 answer

It turns out it was a loading error. I just manually set the UI at the beginning under playergui instead, and it worked, so the issue is resolved.

This discussion is preserved as it was. New answers, comments, and votes are closed.