GetAttributeChangedSignal - 2 scenarios/outcomes but what is the difference?

Hi,

I was working on a project when I noticed a different outcome for GetAttributeChangedSignal in two different scenarios, but I don’t see the difference.

First, the project hierarchy is as follows:
image

Frame has an attribute “Points” which can change. This is tracked by using GetAttributeChangedSignal. When working on the code, I noticed a different outcome for two variations of the same code, and I don’t really see why they behave differently. For context, the TextFixer script is the script where the following lines of code were executed. The code in question is stated below:

-- Returns nothing when the frame attribute has changed
script.Parent:GetAttributeChangedSignal("Points"):Connect(function()
   print("Changed.")
end) 

-- Returns "Changed." when the frame attribute has changed
StarterGui.ScreenGui.Frame:GetAttributeChangedSignal("Points"):Connect(function()
   print("Changed.")
end)

Is this an engine bug?
Thanks in advance.

It because you are changing the starterGui not PlayerGui:

The starterGui children when a player enter they clone and moves to player.PlayerGui

So the script will work if you go to game.Player.ThePlayer.PlayerGui

1 Like

Right, didn’t notice because it’s been a while haha. Thanks!