local music = game.Workspace.BGM
script.Parent.MouseButton1Click:Connect(function()
if music.Volume == 0 then
music.Volume = 1
else
music.Volume = 0
while music.Volume == 0
do
script.Parent.Image = "rbxassetid://5095895372"
script.Parent.MouseButton1Click (function()
script.Parent.Image = "rbxassetid://5034216966"
end
end
end
end)
This is a LocalScript inside of a ImageButton inside of a ScreenGui inside of StarterGui
What it is supposed to do is when I press the ImageButton it turns the sound "BGM" off and turns the ImageButton to another Image

8 comments
an error accours at line 10: expecting end to close function at line 3
Sorry, just put a ) after the end on line 10.
oh ok
huh still does not work
any errors?
does not say
actually, it says Expected identifier when parsing expression got')'
I edited my script, it should work now. :)