Problem with checking all items

I have a problem where if a pizza has 3 toppings, it doesn’t always set all 3 toppings to be done, and thus CurrentPizza.Complete.Value never gets set to true

local function checkPizza()
	local HasCheese = false
	local HasSauce = false
	local HasTopping1 = false
	local HasTopping2 = false
	local HasTopping3 = false
	
	if CurrentPizza:FindFirstChild('Cheese') then
		HasCheese = true
	end
	
	if CurrentPizza:FindFirstChild('Sauce') then
		if CurrentPizza.Sauce.SauceType.Value == CurrentSauce then
			HasSauce = true
		end
	end
	
	if #Toppings > 0 then
		if #Toppings >= 1 then
			if CurrentPizza:FindFirstChild(Toppings[1]) then
				HasTopping1	= true
			end
			
			if #Toppings == 1 then
				if HasCheese and HasSauce and HasTopping1 then
					CurrentPizza.Complete.Value = true
					speedUpConveyor()
				end
			end
			
			if #Toppings >= 2 then		
				if CurrentPizza:FindFirstChild(Toppings[2]) then
					HasTopping2	= true
				end
				
				if #Toppings == 2 then
					if HasCheese and HasSauce and HasTopping1 and HasTopping2 then
						CurrentPizza.Complete.Value = true
						speedUpConveyor()
					end
				end
				
				if #Toppings == 3 then	
                    -- If there are 3 toppings, this section of code doesn't always run?
					if CurrentPizza:FindFirstChild(Toppings[3]) then
						HasTopping3	= true
					end
					
					if HasCheese and HasSauce and HasTopping1 and HasTopping2 and HasTopping3 then
						CurrentPizza.Complete.Value = true
						speedUpConveyor()
					end
				end
			end
		end
	else
		if HasCheese and HasSauce then
			CurrentPizza.Complete.Value = true
			speedUpConveyor()
		end
	end
end

I would need to see the code that actually adds the toppings to the Toppings table in order to see the full context of what you are working with. You should also try print debugging to find exactly which line the code stops on and under what circumstances.

Can you elaborate on this and show me the table that is Toppings that seems to be outside of this function.

I’m not sure if your problem is still occurring, but from what I see with what has been provided. It’s possible that your table is containing more than 3 items. I suggest you print the #Toppings to debug if any duplicated are being added or change the == 3 to a >= 3 expression.