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

How To Change Image Label/Button On Click?

Asked by 4 years ago
Edited 4 years ago

I need this for a mute button and i cant seem to find out the error (No Output Errors) . This is the code:

1script.Parent.MouseButton1Click:connect(function()
2--My Music Mute Script Here--
3script.Parent.Image = 0 --Image Goes ID here--
4end)

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Hi Christopher_magical!

You need to add rbxassetid:// to the Asset ID (The Asset ID are the numbers). I also recommend using :Connect() instead of :connect()

Try this:

1local id = 0 --put your id there
2script.Parent.MouseButton1Click:Connect(function()
3   script.Parent.Image = "rbxassetid://"..id
4end)

Hope I helped, LennyPlayzYT

0
Thanks Dude It Works! Christopher_magical 9 — 4y
Ad

Answer this question