Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a brick play a sound when it is touched?

Asked by 10 years ago

I want to make a brick that plays a sound when it is touched. It will be a door to a shop that rings a little bell when you touch the door. I think it has something to do with touch interest but I'm not sure! I also need it to be for everyone to hear not just me.

Thanks! :D

1 answer

Log in to vote
-1
Answered by 10 years ago

function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") local sound = script.Parent.Bowser if (humanoid ~= nil) then sound:play(1) end end script.Parent.Touched:connect(onTouch)
Ad

Answer this question