GetAttributeChangedSignal Wont Fire

local player = game.Players.LocalPlayer

local audiosettingmusic = player.PlayerGui:WaitForChild('Audio'):WaitForChild('Frame'):WaitForChild('TextButtonMusic')

audiosettingmusic:GetAttributeChangedSignal('ToggleMusic'):Connect(function()
	print('test')
end)

I having this issue where GetAttributeChangedSignal wont fire. This is in a local script in started player scripts. But when the attribute changes it doesn’t fire the event.

If I try audiosettingmusic:getAttribute(“ToggleMusic”) from later on in the code It will always return the original value of the attribute even when its changed, So there is something im not understanding, I hoping I could get some clarity on whats going on.

I did find however, If I do put a task.wait() for 1 or 2 seconds before declaring the variables it works normal.

1 Like

If the code isn’t detecting the update and it only works when you wait, the issue is probably that things get moved around or cloned. You can try having a while task.wait(1) do loop running just after you declare it and print(audiosettingmusic:GetFullName()) to see if it’s being cloned.

1 Like

So it does seem like its getting moved around, tbh I thought It was something on Roblox’s end. Thanks for the help, I will figure out the rest on my mine end. Thanks