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:

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

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:

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

Hope I helped, LennyPlayzYT

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

Answer this question