I finally got somewhere with making a car explode for my Game, however when I hit any of the 120 bricks (Walls) it won't run the script. Could anybody help me out here?
debounce = false
S = script.Parent
script.Parent.Touched:connect(function(Explode)
if debounce == true then return end
debounce = true
if Explode.Parent.Parent.Parent:FindFirstChild("Wall") then
S.Fire.Enabled = true
S.Smoke.Enabled = true
wait(4)
S.Parent.Sound:Play()
e = Instance.new("Explosion")
e.Parent = S
e.Position = S.Position
e.BlastRadius = 10
e.BlastPressure = 5000000
S.Fire:Destroy()
S.Smoke:Destroy()
S.Parent.VehicleSeat.MaxSpeed = 0
S.Parent.VehicleSeat.Torque = 0
S.Parent.VehicleSeat.TurnSpeed = 0
debounce = false
end
end)

3 comments
It didn't work, but I appreciate you trying. It seems that it's when there's more than one brick with the same name, only one will work when it gets touched. Thanks again.
Oh! Then you should you a for loop to take all the parts within the car. I'll post the script and see if it works.
Ok, thank you very much Darknesschaos.