Hello. Im making a bomb that will delete anything that touches the hitbox. The problem comes because i use hitbox:GetTouchingParts() which is a table value and i cant do GetTouchingParts():Destroy because its a table value. Heres my script. Op is a circle part that is unanchored and deletes and explodes after a bit.
like @Rescriptedd said your parttouched variable is actually an array of objects which are currently touching the hitbox, so you can loop through it and destroy each part.
local hitbox = Instance.new("Part", workspace)
local parttouched = hitbox:GetTouchingParts()
hitbox.Anchored = true
hitbox.CanCollide = false
hitbox.Position = op.Position
hitbox.Size = Vector3.new(10, 10, 10)
op:Destroy()
for _, part in parttouched do -- "part" can be anything, just make sure part:Destroy() is the name followed with :Destroy()
part:Destroy() -- destroys all the parts found inside the hitbox
end
task.wait(1)
hitbox:Destroy()