Intermission Timer Not working on my round system!

So I was working on a cool game idea I had and after finishing the round system I found that the timer value wasn’t counting down. Oddly, there were no errors to be found!

I have tried changing the TimeValue (which was a NumberValue) to an IntValue, however that did nothing.

The part of the code that I suspect (Server Side)

ServerStorage = game:GetService("ServerStorage")
ReplicatedStorage = game:GetService("ReplicatedStorage")
Players = game:GetService("Players")

Maps = ReplicatedStorage:WaitForChild('Maps'):GetChildren()
Status = ReplicatedStorage:WaitForChild('NameStatus')
TimeStatus = ReplicatedStorage:WaitForChild('TimeStatus')

while true do
	
	-- Intermission

	local Countdown = 20 -- Intermission time

	repeat wait(1)
		Countdown = Countdown - 1

		TimeStatus.Value = Countdown
		Status.Value = "Intermission"
	until Countdown <= 0

The script to actually show it on the textlables:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Status = ReplicatedStorage:WaitForChild('NameStatus')
local TimeStatus = ReplicatedStorage:WaitForChild('TimeStatus')

local NameStatusText = script.Parent.MapName
local TimeStatusText = script.Parent.MapTime

NameStatusText.Text = Status.Value
TimeStatusText.Text = TimeStatus.Value

Status.Changed:Connect(function()
	NameStatusText.Text = Status.Value
	TimeStatusText.Text = TimeStatus.Value
end)
1 Like

I don’t know if this code really works:

If I want to get the changing value from the intValue on the ServerStorage heres what I’m gonna do instead:

--LocalScript
local ServerStorage = game:GetService("ServerStorage")
local TimerValue = ServerStorage:WaitForChild("TimerValue")

-- // Lets say theres only a single TextLabel on the parent
local MainText = script.Parent:WaitForChild("TextLabel")

-- Read the TimerValue's value and copy it and paste to MainText's text

-- // Initialize first
MainText.Text = "Time Left: "..TimeValue.Value

-- // Now we will check if the property "Value" of TimeValue has changed
TimeValue:GetPropertyChangedSignal("Value"):Connect(function()
    -- // Update the Text
    MainText.Text = "Time Left: "..TimeValue.Value
end)

I used this method :GetPropertyChangedSignal() and it works realy well as I use it on some of my own games.

Let me know if I got some errors.

It’s done on separate text labels.

Well, you can just add more :GetPropertyChangedSignal() and it will works too.


Sidenote:

  • Sorry if I’m not giving you the full code that answers your problem because It might considered as Spoon Feeding as they say.
1 Like

This ended up working:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Status = ReplicatedStorage:WaitForChild('NameStatus')
local TimeStatus = ReplicatedStorage:WaitForChild('TimeStatus')

local NameStatusText = script.Parent.MapName
local TimeStatusText = script.Parent.MapTime

NameStatusText.Text = Status.Value
TimeStatusText.Text = TimeStatus.Value

TimeStatus:GetPropertyChangedSignal("Value"):Connect(function()
	TimeStatusText.Text = TimeStatus.Value
end)

Status:GetPropertyChangedSignal("Value"):Connect(function()
	NameStatusText.Text = Status.Value
end)

Thank you!

I’m glad that I helped you to get the answer!

Good luck and have fun making games!

1 Like