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

How do you remove a brick when hit?

Hi guys! I'm making a Bowling game, and I'm wondering how do you remove the pins when it falls down to the ground? I have this script where it says when it hits, it removes, but it doesn't when I go into Test Mode! Please help! I also have a Regen Button attached to it so I don't know what else to do.

if script.Parent.Name == "Pin" then
function onTouched(hit)
	if hit.Parent.Parent.Name == "Pin" then
		hit.Parent.Parent:Remove()
	end
end

script.Parent.Touched:connect(onTouched)

function go()
wait(0.01)

script.Parent:remove()

end

end

script.Parent.Activated:connect(go)

1 comment

0

block code plz

1 answer

✓ Accepted answer

If you want to get a brick to be removed when touched then do this:

function onTouch()

script.Parent:remove()

end
game.Workspace.Player.Touched:connect(onTouched)

Its kind of the same with a gun's bullet, just with some tweaking.

1 comment

0

Thank you so much!

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