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

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

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

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.

1 comment

0

This worked for me! Thanks!

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