I can’t believe I ran into another simple issue on my very simple script.
I wanted to make a part be able to disappear after a particle effect to give it the glass break effect when it collides with a bullet in-game. This is what I have so far.
function onTouch(hit)
** if hit.Name == “Bullet” then **
** script.Parent.Transparency=1**
** script.Parent.CanCollide=false**
end
end
script.Parent.Touched:connect(onTouch)
My issue is the hit-name. The bullets in the debris folder are named after the creator with ‘bullets’ after it. For example, a bullet I created would be named PROTO_TECH_bullet. This is my problem. The script will not fire if the hit function only functions when it looks for a part named Bullet, because everyone’s username will be different and that will change the name of the bullet part in the debris folder. Anybody have a solution? (I can’t believe I’m asking help for this.)