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)
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.