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

Sound script won't stop music?

Asked by
Zerio920 285 Moderation Voter
10 years ago

I have this in a localscript:

local player = game.Players.LocalPlayer

local music = player.Backpack.Inside
if player.Backpack:FindFirstChild("Outside") or player.Backpack:FindFirstChild("Outside2") then
if player.Backpack.Outside.IsPlaying == true then
player.Backpack.Outside:Stop()
elseif player.Backpack.Outside2.IsPlaying == true then
player.Backpack.Outside2:Stop()
end
music:Play()    
end

It's supposed to stop playing the sounds "Outside" and "Outside2" in the Backpack and play "Inside" instead. However it doesn't stop "Outside" nor play "Inside". Any ideas?

Answer this question