So I am trying to make a building system, with snapping, but the snap parts are not deleted when I fire the script, can anyone help me?
for _,q in pairs(game.Workspace:GetDescendants()) do if q:IsA("Part") then for _,s in pairs(game.Workspace:GetDescendants()) do if s:IsA("Part") then if s.Position == q.Position and s~= q then if string.sub(s.Name,1,1) == "e" and string.sub(q.Name,1,1) == "SP" then q:Destroy() elseif string.sub(q.Name,1,1) == "e" and string.sub(s.Name,1,1) == "SP" then s:Destroy() else local r= math.random(0,1) if r== 0 then s:Destroy() else q:Destroy() end end end end end end end
the place is on my profile, its called "Random Testing Environment"Link