Hello, I’m trying to detect parts with a DragDetector using :GetTouchingParts but I can’t figure out how to separate the parts that do have a DragDetector inside of it and ignore the ones that don’t. Here is what I’ve done so far
for i,v in pairs(DestroyPart:GetTouchingParts()) do
if v.DragDetector then return end
local list = v
list:Destroy()
end
for i, v in pairs(DestroyPart:GetTouchingParts()) do
if v:FindFirstChild("DragDetector") then -- this way, if it doesn't have it, it would just skip onto the next part
-- do whatever you need here
local list = v
list:Destroy()
end
end
for i, v in pairs(DestroyPart:GetTouchingParts()) do
if not v.DragDetector then
-- part doesn't have a DragDetector, skip to the next
continue
end
-- part has a DragDetector, perform actions here
local list = v
list:Destroy()
end
:gettouchingparts is currently broken or atleast it doesnt work right. I suggest using a script that uses .touched to each of the parts and sending it to a signal.
you can make a script to insert these script into the parts.