so theres a menu gui, and this script is inside the play button.
a sound is playing.
how can I make it so if I click, the r2dm sound stops and the other sound plays?
if you want to help me, make sure the sound stops and r2dm plays if the player dies. thanks.
local song = script.Parent:WaitForChild("Sound") --normal song
local menus = script.Parent:WaitForChild("R2DM") --menu song
menus:Play()
function onClicked(GUI)
menus:Stop()
song:Play()
end
script.Parent.MouseButton1Click:connect(OnClicked)

6 comments
music still doesnt play. got any solution?
i am an avid hater of indented code. i make my whole code 1 line so if someone want's to exploit my game they have to strain their eyes trying to read what i've done. some may say its just an excuse for being a bad scripter, however i say it is genius.
can u guys answer
Are you sure
songis pointing to a proper Sound object?Try using local, its a quick way to get around things e.x: local menus = script.Parent.menus:Play()
There are a few reasons if the music isn't playing " ITS NOT LOADED! " or " THERE IS NO MUSIC" or, the Volume of the Sound is ZERO, otherwise the script looks fine.