I'm trying to make a tool that when clicked, it will summon a part that then checks if any parts it touches is unanchorable, and if so, it will unanchor it. I'm trying to do this in large quantities, so I can't use a ClickDetector or put a script into every part. I can, however, put a script into the tool, the part that unanchors touched parts, or the folder of parts. I've tried a script in the part that basically unanchors anything detected with the part.Touched event, and it didn't work. This is the script that is currently in the folder:
wait()
while true do
local destrutableObjects = script.Parent:GetChildren()
wait()
for i,obj in pairs(destrutableObjects) do
if obj:IsA("BasePart") then
obj.Touched:Connect(function(hit)
if hit.Name == "Explosion" then
obj.Anchored = false
end
end)
end
end
end
There are no errors. I've tried debugging with print() functions, and it seems that it never activates the function, but gets into the for loop. I have no idea why. Again, I cannot put an Instance into every part for performance on low-medium devices.

1 comment
comment for 116'000th question!