When the button is clicked, the music stops as intended. However, instead of displaying the off image, it simply disappears. It then reappears whenever you click it again. These beautiful assets were created by my friend and I wouldn’t like them going to waste. Here is the code:
local button = script.Parent
local on = true
local voloff = "rbxassetid://6598165869"
local volon = "rbxassetid://6598167222"
script.Parent.MouseButton1Click:Connect(function()
if on == true then
on = false
button.Image = voloff
workspace.Music:Pause()
elseif on == false then
on = true
button.Image = volon
workspace.Music:Play()
end
end)
Here is a video of the bug in action.
robloxapp-20210822-2136509.wmv (1.6 MB)
Neither of the sprites have been moderated. Help needed!