I added the ImageButton where it says function onButton1Down(mouse)But what happened, was that it did pop up, but instead the button didn't work after I clicked it and it didn't ger removed or destroyed after I clicked it. Also, on the last line for MouseButton1Down I don't know how to make it work either since I am using Instance.new()Please help me out here. I added the explanation to each of them using my knowledge as possible. This is the script:
local song1 = game.Workspace.BoxCD.song1 -- CD Model name
local disc1 = game.Workspace.PlainDisc.Decal -- Disc with Decal
local gui = game.StarterGui -- GUI
local screen = Instance.new("ScreenGui", gui) -- ScreenGUI
local image = Instance.new("ImageLabel", screen) --ImageLabel
local insert = Instance.new("ImageButton", screen) --ImageButton
touch = false -- Just another thing to add if I player touched it
inserted = false -- ImageButton says Insert, and it is like the touch = false but instead it inserts or change the decal of the CD
function onClicked(clicker) -- Clicker clicked
if not touch then -- If it is not touch then
touch = true -- Make it true for touch
local screen = Instance.new("ScreenGui", clicker.PlayerGui) --Screen gui and where it goes
local image = Instance.new("ImageLabel", screen) -- ImageLabel and where it goes
local insert = Instance.new("ImageButton", screen) -- ImageButton and goes with screen
image.Position = UDim2.new(0, 500, 0, 25) --Position of the Image
image.Size = UDim2.new(0, 450, 0, 500) -- Size of it
image.Image = "rbxassetid://238387775" --Image ID
insert.Position = UDim2.new(0, 830, 0, 485) -- Insert as in ImageButton position
insert.Size = UDim2.new(0, 120, 0, 40) -- ImageButton size
insert.Image = "rbxassetid://70392447" --ImageButton Image Id
touch = false -- And when everything is done with it, the touch is back to false
end
end
function onButton1Down(mouse) --Clicking the ImageButton using the Mouse
if not inserted then -- If it is not inserted then
inserted = true -- Insert it
disc1.Texture = "rbxassetid://238387775" --Changing the decal of the disc to this ID
inserted = false -- And then it is done
screen:Destroy() --Removes the screen gui
image:Destroy() -- Removes image
insert:Destroy() -- removes the button
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
script.Parent.MouseButton1Down:connect(onButton1Down) -- I am not sure how to use this part when the ImageButton and others happens to be `Instance.new`
OutPut:
21:34:31.556 - MouseButton1Down is not a valid member of UnionOperation 21:34:31.556 - Script 'Workspace.BoxCD.song1.Union.Song1', Line 35 21:34:31.557 - Stack End

2 comments
Is the Gui active and Visible, (You check to make sure in Property panels of the Screen Gui Instance)
I checked it, and not even a pop up or anything. The Gui and ImageLabel worked, and then I added the ImageButton, but that like made it not popup anymore and also the ImageButton didn't work after clicking it