Greetings, I made a random music script, however I’m trying to connect it to a setting, but that doesn’t seem to be working, as I have an image that updates to a check mark in a box (on), and just a box (off), however when i do Image.Changed:Connect(function() it doesn’t seem to work. Any help with this would be appreciated.
local Music = game:GetService("Workspace").Music
game:GetService("Players").PlayerAdded:Connect(function(Player)
Player.PlayerGui:WaitForChild("Settings").Menu.MusicButton.Changed:Connect(function()
print("Changed") --Doesn't print, .Changed doesn't work
if Player.PlayerGui.Settings.Menu.MusicButton.Image == "http://www.roblox.com/asset/?id=4458804262" then
Music.Playing = true
while Player.PlayerGui.Settings.Menu.MusicButton.Image == "http://www.roblox.com/asset/?id=4458804262" do
local RandomSong = MusicList[math.random(1,#MusicList)]
Music.SoundId = "rbxassetid://"..RandomSong
Music.Playing = true
task.wait(Music.TimeLength)
end
else
Music.Playing = false
end
end)
end)