Hello. So I’m trying to make a trip mine so that when a player steps on it it explodes and kills them.
That part of it works but I’m also trying to make it break parts that have both A. a folder named “Behaviors” inside it and B. a Bool Value named “Mineable” inside the folder. It explodes just fine but it’s not breaking the parts.
Here is my code:
script.Parent.Touched:Connect(function()
local Explotion = Instance.new("Explosion", script.Parent)
Explotion.ExplosionType = Enum.ExplosionType.NoCraters
Explotion.Position = script.Parent.Position
Explotion.BlastRadius = 6
Explotion.Hit:Connect(function(hit)
if hit.Parent:FindFirstChild("Behaviors") then
if hit.Parent:FindFirstChild("Mineable") then
hit.Parent:Destroy()
end
end
end)
end)
I’m trying to make it where it both kills the player (That part works) and breaks every part around it with the Behavers folder and the Mineable Bool Value inside it.