Can anyone spot whats wrong with my logic?

So I’m working on a car spawner pad thing and I made some check to determine if something is in the way of where the car would be spawned. And it works the first time but not the second, for instance if I try to spawn a sedan twice it won’t spawn however if I try to spawn another variant of car like an SUV or something then it will spawn it as if the bool value isn’t true?

My script:

local region = Region3.new(script.Parent.r1.Position, script.Parent.r2.Position)

while wait() do
	if workspace:FindPartsInRegion3(region) then
		for i,v in pairs(workspace:FindPartsInRegion3(region)) do
			if v.Name ~= "r1" and v.Name ~= "r2" then
				print("Found part!")
				script.Parent.hasCar.Value = true
			elseif v.Name == "r1" or v.Name == "r2" then
				print("No parts!")
				script.Parent.hasCar.Value = false
			end
		end
	end
end

It could be that your region3 isn’t positioned where you think it is. Since region3 takes a minimum position and a maximum position. You can double check that you are creating a region3 where you want by instancing a part, and then making said part the same size and position as the region3. Also, there is an ignore list property for FindPartsInRegion3, so you can pass r1 and r2 in there in a table.

They both would run and the value would be false as they both have the same requirements

It is where it should be i did instance a part and its the right size and position.

I rewrote the script and came across some flaws i made its fixed now.