alright for this script right here the explosion does print the parts it hit that are not locked but it also runs the if statement even when the basePart.Parent.Name does not equal Blue or Red it also destroys anything that is within a model and give a parent is nil value error and workspace is locked error
script:
workspace.ChildAdded:Connect(function(obj)
if obj:IsA("Explosion") then
obj.Hit:Connect(function(basePart, distance)
print(basePart.Name)
if basePart.Parent.Name == "BlueBarrel" or "RedBarrel" then
basePart.Parent:Destroy()
end
end)
end
end)

3 comments
oh alright thank you so much man i would pay you if i could
Don't worry. No need to pay, I like helping people and seeing them getting happy when I help them is more than enough reward to me.
you can pay him in thankfulness lol