I just learned how too make sound play when the player touches a brick, but when the player enters a different room how do i make the first sound stop, and another sound play when they touch a different brick?
The Stop()
method is what you would use to stop the sound.
Here's a wiki page
You would use it in the same way that you used the Play()
method:
local Sound = workspace.ExampleSound Sound:Stop()
EDIT
To have it so that it stops the sounds when you touch a button, use the Touched
event on your button part:
local Part = workspace.Part local Sound = workspace.ExampleSound Part.Touched:connect(function(ThingThatTouched) --Will run when "Part" is touched if (ThingThatTouched.Parent:FindFirstChild("Humanoid")) then --If it is a player/NPC Sound:Stop() end end)