I have scoured the devforums, youtube videos, and the documentation page, and even tried straight up brute force but was unable to find a solution to my problem that worked for me and this script.
I wish to simply change this ImageButton’s Image into a different image once clicked, showing that the mute button is enabled(muted)
instead, as shown, the current image (located within the script and the ImageButton itself, disappears and does not reappear after unmuting, nor does the mute icon show up
The setup:
Current Script
local ImageButton = script.Parent
script.Parent.MouseButton1Click:Connect(function()
if muted == false then
muted = true
game.Workspace.Music.Volume = 0.4
wait(0.1)
game.Workspace.Music.Volume = 0.3
wait(0.1)
game.Workspace.Music.Volume = 0.2
wait(0.1)
game.Workspace.Music.Volume = 0.1
wait(0.1)
game.Workspace.Music.Volume = 0
ImageButton.Image = 14501633525
else
muted = false
game.Workspace.Music.Volume = 0.1
wait(0.1)
game.Workspace.Music.Volume = 0.2
wait(0.1)
game.Workspace.Music.Volume = 0.3
wait(0.1)
game.Workspace.Music.Volume = 0.4
wait(0.1)
game.Workspace.Music.Volume = 0.5
ImageButton.Image = 14501631822
end
end)
This is a script that can be found here, community provided .
If anyone can help, or even point in the right direction that would be super, thanks !