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)

4 comments
The parent parameter of Instance.new is deprecated, assign the parent in another line. connect is deprecated, switch to Connect.
Will that even work? Is it just from connect to Connect?
It isn’t the problem, but deviating from deprecated code is always good practice.
I saw the link of it, but it is something I am not familiar with or even know how to do.