Okay. Last time I asked the question, it was closed because I wasn't specific. My script isn't functioning like I want it to do. What I am trying to do is click the CD to Insert the CD and if the texture on the CD is Uptown Funk, then it will play Uptown Funk then. As in whatever the decal is on the CD, will play that song after clicking on. Here is the video of what it looks like and how it is messed up and not functioning like I wanted it to do. And the script of it.
https://twitter.com/BTKB_RBLX/status/1017640784722571264
local arrow = game.Workspace.Arrow local disc = game.Workspace.PlainDisc2.Decal local sound = Instance.new("Sound", disc) debounce = false radioOn = false function onClicked() -- Clicked if not debounce then debounce = true if not radioOn then radioOn = true -- Turn Radio on disc.Texture = "rbxassetid://238387775" --Uptown Funk sound.SoundId = "rbxassetid://235468324" arrow.Rotation = Vector3.new(90, 45.631, -180) -- Turn to turn the music on sound:Play() --Play it elseif radioOn then disc.Texture = "rbxassetid://98698696" --Gangnam Style sound.SoundId = "rbxassetid://130844430" --Play Gangnam Style arrow.Rotation = Vector3.new(90, 45.631, -180) -- Turn to turn the music on sound:Play() --Play it elseif radioOn then disc.Texture = "" -- Set Disc texture to nothing radioOn = false -- Turn Radio off sound:Stop() --Stops the sound arrow.Rotation = Vector3.new(-90, -45.631, 0) --This arrow should go back before the disc is plain and radioOn is false print("Off\n".."PlainDisc") -- prints end debounce = false end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
I think your if statements are your problem. If the radio is off turn it on and play uptown funk else if it is on play gangnam style else if it is on (this will never run because it is the same as the last if) stop the music.