Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

The explosion's .Hit event issues?

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

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)

1 comment

0

Sorry, Copy and pasted too short. I have that end in the real script, anymore suggestions?

This discussion is preserved as it was. New answers, comments, and votes are closed.