Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

The explosion's .Hit event issues?

Asked by
yurhomi10 192
9 years ago

My problem, It WORKS but DOESN'T WORK like I would. What I mean by that is, whenever an explosion hits a part, it's supposed to be removed. But the thing is, when it hits multiple parts, it only destroys one, the bricks are unlocked and I don't know what else to do with this. Nothing in output comes up.

e = Instance.new("Explosion", game.Workspace)
    e.Position = script.Parent.Position
    e.BlastPressure = 1000000
    e.BlastRadius = 10
    e.Hit:connect(function(part, distance)
        if part:IsA("Part") and part.Locked == false then 
            part:Destroy()
        else
            print(part.Name .. " is not a part")
        end

1 answer

Log in to vote
0
Answered by
TopDev 0
9 years ago

It was missing an end, it may or may not be the problem but try it out and let me know.

e = Instance.new("Explosion", game.Workspace)
    e.Position = script.Parent.Position
    e.BlastPressure = 1000000
    e.BlastRadius = 10
    e.Hit:connect(function(part, distance)
        if part:IsA("Part") and part.Locked == false then 
            part:Destroy()
        else
            print(part.Name .. " is not a part")
        end
        end)
0
Sorry, Copy and pasted too short. I have that end in the real script, anymore suggestions? yurhomi10 192 — 9y
Ad

Answer this question