[UNSOLVED] Having issues with team color

Hey so recently I noticed that my script team color breaks the script.

here’s the code

local TeamColor = "Gold"

local plr = game.Players.LocalPlayer
local event = game.ReplicatedStorage:WaitForChild("TeamEvent")
local button = script.Parent
local DelayWaitTime = script.Parent.Parent.Parent.DelayTime
local x = script.Parent.Parent.Parent.Value
if x.Value == false then return end
local clicked = false
button.MouseButton1Down:connect(function()
	if x.Value == false then return end

	if plr:GetRankInGroup(12558116) > 2 or plr.UserId == 831343583 or plr.UserId == 195269136 then
		if not clicked then
			clicked = true
			local teamGuiName = button.Text
			for i = DelayWaitTime.Value,0,-1 do
				button.Text = teamGuiName.." ("..i..")"
				wait(1)
			end
			wait()
			event:FireServer(TeamColor)
			clicked = false
		end
	end
end)

but it works with this


local plr = game.Players.LocalPlayer
local event = game.ReplicatedStorage:WaitForChild("TeamEvent")
local button = script.Parent
local DelayWaitTime = script.Parent.Parent.Parent.DelayTime
local x = script.Parent.Parent.Parent.Value
if x.Value == false then return end
local clicked = false
button.MouseButton1Down:connect(function()
	if x.Value == false then return end

	if plr:GetRankInGroup(12558116) > 2 or plr.UserId == 831343583 or plr.UserId == 195269136 then
		if not clicked then
			clicked = true
			local teamGuiName = button.Text
			for i = DelayWaitTime.Value,0,-1 do
				button.Text = teamGuiName.." ("..i..")"
				wait(1)
			end
			wait()
			event:FireServer(TeamColor)
			clicked = false
		end
	end
end)

anyone have same problem?