I'm making a nuke script where if a player touches it they die, but if it's a part then it's destroyed. However, it's not destroying the parts!
local explosion = Instance.new("Part",workspace)
explosion.Position = script.Parent.thing.Position
wait(0.1)
script.Parent.Nuke:Destroy()
explosion.Shape = "Ball"
explosion.BrickColor = BrickColor.new("Bright green")
explosion.Material = "Foil"
explosion.CanCollide = false
explosion.Anchored = true
for i = 5,0,-1 do
explosion.Size = explosion.Size * 2
wait(0.3)
explosion.Touched:Connect(function(part)
if part and part.Parent:FindFirstChild("Humanoid") then
part.Parent:FindFirstChild("Humanoid"):TakeDamage(100)
else
part:Destroy()
end
end)
end

1 comment
In line 14. Remove the "part and" bit.