Bug when making round system (Topbar+ Icons)

So I’m using TopbarPlus v2 when making a round system. But the game in progress value when changed causes the local script to break.

Find the comment with “bugged area”.

local Icon = require(game:GetService("ReplicatedStorage").Icon)

local icon = Icon.new()

icon:setImage(7072707021)
icon:setLabel("Teleport to ranked")

icon:setTip("Teleport to the ranked players server (E)")

icon:bindToggleKey(Enum.KeyCode.E)

local icon2 = Icon.new()

icon2:setRight()

icon2:setImage(7072723337)
icon2:setLabel("Plan a castle raid")

icon2:setTip("Plan a castle raid by destroying it's defense and their body guards! (Q)")

local gameplayIcon = Icon.new()

gameplayIcon:setMid()
gameplayIcon:lock()

gameplayIcon:setImage(7072707248)

if game.ReplicatedStorage.GameplayUtilies.GameplayInProgress.Value == true then
	gameplayIcon:setLabel("Remaining Time: "..game.ReplicatedStorage.GameplayUtilies.SecondsRemaining) -- bugged area

	game.ReplicatedStorage.GameplayUtilies.SecondsRemaining.Changed:Connect(function(value)
		gameplayIcon:setLabel("Remaining Time: "..value)
	end)
	
	game.ReplicatedStorage.TeamWins.OnClientEvent:Connect(function(teamName)
		if teamName == "None" then
			game.ReplicatedStorage.GameplayUtilies.GameplayInProgress.Value = false
			gameplayIcon:setLabel("No one wins")
			gameplayIcon:setImage(7072716549)
		else
			game.ReplicatedStorage.GameplayUtilies.GameplayInProgress.Value = false
			gameplayIcon:setLabel(teamName.." wins!")
			gameplayIcon:setImage(7072716549)
		end
	end)
else
	gameplayIcon:setLabel("Remaining Time: N/A")
end

game.ReplicatedStorage.GameplayUtilies.GameplayInProgress.Changed:Connect(function()
	if game.ReplicatedStorage.GameplayUtilies.GameplayInProgress.Value == true then
		gameplayIcon:setLabel("Remaining Time: "..game.ReplicatedStorage.GameplayUtilies.SecondsRemaining) --Bugged area

		game.ReplicatedStorage.GameplayUtilies.SecondsRemaining.Changed:Connect(function(value)
			gameplayIcon:setLabel("Remaining Time: "..value)
		end)

		game.ReplicatedStorage.TeamWins.OnClientEvent:Connect(function(teamName)
			if teamName == "None" then
				game.ReplicatedStorage.GameplayUtilies.GameplayInProgress.Value = false
				gameplayIcon:setLabel("No one wins")
				gameplayIcon:setImage(7072716549)
			else
				game.ReplicatedStorage.GameplayUtilies.GameplayInProgress.Value = false
				gameplayIcon:setLabel(teamName.." wins!")
				gameplayIcon:setImage(7072716549)
			end
		end)
	else
		gameplayIcon:setLabel("Remaining Time: N/A")
	end
end)

Does anyone knows how to solve this?

Here is the output error:

is there any error in the output

1 Like

The output error looks like this:

gameplayIcon:setLabel("Remaining Time: "..game.ReplicatedStorage.GameplayUtilies.SecondsRemaining.Value)

edit that line to this i guess

I think I forgot the value. Let me try that.

The solution was found.

1 Like