-- animação para o TextLabel

local function animateTextLabel()
	local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local startingText = textLabel.Text
	local currentValue = tonumber(numValue.Value)
	local targetValue = currentValue
	local decimal = string.match(tostring(currentValue), "%.(%d+)")
	if decimal then
		targetValue = math.floor(currentValue)
	end
	for i = 1, 10^(#tostring(targetValue)-1) do
		local newValue = currentValue - (currentValue % i)
		if newValue == targetValue then
			textLabel.Text = commaSeparateNumber(tostring(newValue)) .. (decimal and "." .. decimal or "")
			break
		else
			textLabel.Text = commaSeparateNumber(tostring(newValue)) .. (decimal and "." .. decimal or "")
			wait(0.05)
		end
	end
	wait(0.5)
	textLabel.Text = startingText
end

updateTextLabel() -- atualiza o TextLabel ao iniciar o jogo
