I am currently working on a Sandbox Tycoon game. And my upgrading script isn't working correctly. There is supposed to be a Money Limit (moneyLimit) functionality, where the ore's value will not go above the Money's Limit. However, it ends up not working. It will upgrade the ore once (I have a way to count it)

Here is the script:

local multiplier = 1.15 --// set what amount the ore's value will be multiplied by

local useLimit = 0 --// 0 removes the limit
local moneyLimit = 100000 --// 0 removes the limit

local Color = BrickColor.new("Deep blue")
local Error = BrickColor.new("Really red")

script.Parent.Touched:connect(function(hit)
	if hit:FindFirstChild("OreValue") then
		if hit:FindFirstChild("Upgrades") then
			if hit.Upgrades:FindFirstChild(script.Parent.Parent.Name) then
				if useLimit == 0 then
					if moneyLimit == 0 then
						hit.OreValue.Value = math.floor(hit.OreValue.Value * multiplier)
						hit.Upgrades[script.Parent.Parent.Name].Value = hit.Upgrades[script.Parent.Parent.Name].Value + 1
					elseif moneyLimit >= 1 then
						if hit.OreValue.Value >= moneyLimit then
							script.Parent.BrickColor = Error
							script.Parent.Error:Play()
							wait(.1)
							script.Parent.BrickColor = Color
						end
					end
				elseif useLimit >= 1 then
					if moneyLimit == 0 then
						if hit.Upgrades[script.Parent.Parent.Name].Value < useLimit then
							hit.OreValue.Value = math.floor(hit.OreValue.Value * multiplier)
							hit.Upgrades[script.Parent.Parent.Name].Value = hit.Upgrades[script.Parent.Parent.Name].Value + 1
						else
							script.Parent.BrickColor = Error
							script.Parent.Error:Play()
							wait(.1)
							script.Parent.BrickColor = Color
						end
					elseif moneyLimit >= 1 then
						if hit.OreValue.Value < moneyLimit then
							if hit.Upgrades[script.Parent.Parent.Name].Value < useLimit then
								hit.OreValue.Value = math.floor(hit.OreValue.Value * multiplier)
								hit.Upgrades[script.Parent.Parent.Name].Value = hit.Upgrades[script.Parent.Parent.Name].Value + 1
							else
								script.Parent.BrickColor = Error
								script.Parent.Error:Play()
								wait(.1)
								script.Parent.BrickColor = Color
							end
						end
					end
				end
			else
				local counter = Instance.new("IntValue", hit.Upgrades)
				counter.Value = 1
				counter.Name = script.Parent.Parent.Name
				hit.OreValue.Value = math.floor(hit.OreValue.Value * multiplier)
			end
		end
	end
end)

Here is a gif to show what happens. https://gyazo.com/833b7f3ba601d8ce4319a1a95786a350

This is where the issue most likely is

					elseif moneyLimit >= 1 then
						if hit.OreValue.Value < moneyLimit then
							if hit.Upgrades[script.Parent.Parent.Name].Value < useLimit then
								hit.OreValue.Value = math.floor(hit.OreValue.Value * multiplier)
								hit.Upgrades[script.Parent.Parent.Name].Value = hit.Upgrades[script.Parent.Parent.Name].Value + 1
							else
								script.Parent.BrickColor = Error
								script.Parent.Error:Play()
								wait(.1)
								script.Parent.BrickColor = Color
							end

The only way I can think its not working is due to some slight error with either spelling or just using < and > the wrong way.