How to get Parts in an area of mouse.Hit?

How do I get the Parts around an area of mouse.Hit?

I want to make it that the parts destroy when you click on them

here is a sketch of what I mean

1 Like

Extremely easy with the new Spatial Query API

local Radius = 10
local Params ="OverlapParams")

-- Perhaps you will want to configure the params to ignore something like the baseplate
-- but you could also just filter those out when iterating over Parts array

local Parts = Workspace:GetPartBoundsInRadius(Mouse.Hit.Position, Radius, Params)

Continuing on your script:

for index, part in pairs(Parts) do

Or if they wanted explosion:

for index, part in pairs(Parts) do
    local Exp ="Explosion", part)
    Exp.Position = part.Position

Also this is partially incorrect.

I believe it is

Tried your script and it’s returning null.