I need to make it so that when someone touches a brick, all audios playing stop playing, so a new audio can play without it playing at the same time as the previous looping audio. This is the script I'm using to play audio, thanks in advance.
function onTouched(hit)
local s = Instance.new("Sound")
s.Name = "Sound"
s.SoundId = "http://www.roblox.com/asset/?id=170071054" -- Audio ID
s.Volume = 1 -- How loud it is
s.Pitch = 1 -- How high pitched it is
s.Looped = true -- If it's looped or not
s.archivable = false
s.Parent = game.Workspace
wait(0)
s:play()
end
script.Parent.Touched:connect(onTouched)