function onTouched(hit)
script.Parent.Audio:play()
end
script.Parent.Touched:connect(onTouched)
✓ ANSWER ACCEPTED
How to make it that this sound block only making sound when a object with a special name hits it ???
1 answer
✓ Accepted answer
You check the name property of the object that hit it.
function onTouched(hit)
if hit.Name == "SpecialName" then
script.Parent.Audio:play()
end
end
script.Parent.Touched:connect(onTouched)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
thx :D