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