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

Make an audio be executed when you touch/go through a block?

Asked by
Vanada 0
10 years ago

In some games, they have different musics for when you go to a certain area, or if you touch a certain block. How do they do that? -- In other words, how do you make a block play/change the music when you touch it?

1 answer

Log in to vote
1
Answered by 10 years ago

All you need is the sound in the brick and enter this code:

script.Parent.Touched:connect(function() -- Brick gets touched and triggers a function
    script.Parent.Sound:Play()--Plays the sound
end) --Done.
0
This worked for me! Thanks! Vanada 0 — 10y
Ad

Answer this question