I have a DJ panel, and I want them to play a song when they click the textbutton, but I don't want them to play 2 songs at a time. So I made this script but it doesn't stop the sound from playing if another one already is?
local s = game.Workspace.Part.Sound local s2 = game.Workspace.Part.Sound2 local b = script.Parent.Parent.Song2.Script script.Parent.MouseButton1Down:connect(function() s.SoundId = "rbxassetid://148321914" s:Play() if s2.IsPlaying == true then s:Stop() print("yes") end end)
There may be an error, correct me if I am wrong. I don't think "IsPlaying" is a bool.
local s = game.Workspace.Part.Sound local.s2 = game.Workspace.Part.Sound2 local b = script.Parent.Parent.Song2.Script script.Parent.MouseButton1Down:connect(function() s.SoundId = "rbxassetid://148321914" s:Play() if s2.IsPlaying then s:Stop() print("yes") end end)
Leave a comment if it didn't work!