Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there another way to script this ImageButton?

Asked by
uZelt 15
9 years ago

I am making surface Gui music Gui. When you click the play button which is next to the song you want, the decal on the ImageButton changes decals from a red play symbol to a green one. When you click the next song I want the previous button the turned green to reset back to, red the current script is:

function Clicked()

     game.Workspace.MusicGUI.SurfaceGui.Frame.MusicButton1.Image = "rbxassetid://240281070"

game.Workspace.MusicGUI.SurfaceGui.Frame.MusicButton2.Image = "rbxassetid://240281070"

 game.Workspace.MusicGUI.SurfaceGui.Frame.MusicButton3.Image = "rbxassetid://240281070"

game.Workspace.MusicGUI.SurfaceGui.Frame.MusicButton4.Image = "rbxassetid://240281070" end Music.MouseButton1Down:connect(Clicked)

I was planning on adding a lot more buttons and I was wondering if there was an easier way of doing this instead of repeating this process?

0
Please put your code in appropriate Lua code block Goulstem 8144 — 9y

Answer this question