So I have a gun that fires a bullet, the bullets are called "Bullet" when I fire a bullet at the trigger brick I wan't it to print I got shot, and else to do nothing if it didn't get shot by a part called bullet. Here's what I have but It won't work! Much appreciated if you could help me! :)
a = script.Parent
function onBrickShot(hit)
if hit.Parent.Name == "Bullet" then
print("I am a brick that has just been shot!")
else
end
end
script.Parent.Touched:connect(onBrickShot)

1 comment
It may not work if bullet is anchored.