I’m trying to find a better way to script this. I’m sure I could figure out a better way through trying different things, but I figured someone would know and save me some time. Thanks.
while true do
wait(1)
for i,v in pairs(game.Workspace.Items:GetChildren()) do
local magnitude = (v.Position - script.Parent.Handle.Position).magnitude
if magnitude <= 8 then
v:Destroy()
end
end
end
You could instead try making a Region3 around your handle and see what parts are in the Region3 and add in a filter to ignore parts you don’t want destroyed.
I think there’s also a limit to how many parts you can find at a time with Region3’s. Let us know if this is a problem for you, there might be ways of working around it.
It would be easier to help you find a good solution to your problem if you tell us what end goal you’re trying to achieve here - there may be a better way altogether.