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

How to make it that this sound block only making sound when a object with a special name hits it ???

function onTouched(hit)
	script.Parent.Audio:play()
end
script.Parent.Touched:connect(onTouched)

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)

1 comment

0

thx :D

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