Attempt to compare number and boolean - Scripting Help

I ran into this error while scripting a product shop. I added multiple prints to see where the code stops.

The code below is to function as a product giver. It finds the player’s generated cash and checks if the value is over 5. If the value is over 5, the designated item will clone into their backpack and 5 cash will be removed from their stat.

The print stops at ("Remote Found") below.

game.ReplicatedStorage.Events.Products.BuyDrink.OnServerEvent:Connect(function(player, item)
 print("Remote Found")
 if CashValue:WaitForChild("Cash").Value == CashValue:WaitForChild("Cash").Value >= 5 then
 	if item == "Bloxy Cola" then
 		CashValue:WaitForChild("Cash").Value = CashValue:WaitForChild("Cash").Value - 5
 		print("Cash Removed")
 		local Cola = game.ReplicatedStorage.Shop.Drinks.BloxyCola:Clone()
 		Cola.Parent = player.Backpack
 		print("Item Given")
 	end
 end
end)

a == b evaluates to true if a is equal to b, otherwise false. However both of the operands are the same so you are doing true >= 5. Just do

if CashValue:WaitForChild("Cash").Value >= 5 then
1 Like