yes and make it invisible and can collide off. sorry that this is such a messy way of doing this.
you are forgetting you must have a touch interest if the part is cancollide false, also your script does not check if the build is touching another build
note that while doing this with an invisible hitbox to make sure it checks for the other part’s hitbox instead of the actual other parts since the original part will be touching its own hitbox as well, falsely adding to the count
yes. this was implied in what I said.
also, it’s the other way around with the touch interest if the part is cancollidable.
I noticed a problem that could happen if someone had multiple parts on the ground and you destroyed the base of one of the builds.
This in theory should loop through all connected parts and return false if there is no valid base.
function baseplatecheck(part)
for r,c in pairs(part:GetTouchingParts()) do
if c then
if c.Name == "Baseplate" then
return true
elseif c.Name == "Hitbox" then
baseplatecheck(c)
else
return false
end
end
end
end
function recheck()
for i,v in pairs(builds:GetChildren()) do
if v then -- Make sure for this part you have a hitbox added.
baseplatecheck(v.Hitbox)
end
end
end