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

How to turn off music, when you touch a brick?

I'm trying to make a game, and I want to turn off the music when you hit a brick. Can any of you answer this?

1 answer

Hello, TheEliteYoutuber0241!

To detect if something hits a object you use .Touched

Example:

-- Object that will detect will be script's parent --
script.Parent.Touched:Connect(function(hit) -- The hit will give the part that collided name
	-- Do things here --
end)

To stop a music, you can use :Stop()

Example:

-- The music part(what emits the music) is script's parent --
script.Parent:Stop()

This isn't a request website, so I can't give you the full script, but this may help you lots =D

Good Luck with your games!

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