I have frankly no idea why this doesn’t work, I seem to be doing everything right, and when placed in another script it works, but in this particular script it doesn’t.
I have a ScreenGui, and the children are a LocalScript and a TextBox. I want to use the ‘GetPropertyChangedSignal’ event to get the text of the TextBox everytime it’s changed, but for some reason it doesn’t work at all and I have no idea why. Below is a picture of how they’re positioned.
It will print nothing because it’s clientsided, and it’s not going to work, because it’s text, the text applies when it’s finished not when it’s being printed.
The preset value won’t be printed, the Changed signal only fires if the Text property changes after you have connected to the signal. The preset value is already set so it won’t be printed.
The standard pattern is something like this if you want to fire a function with the initial value too.
local EnterWords = script.Parent.EnterWords
local function onEnterWordsChanged()
print(EnterWords.Text)
end
EnterWords:GetPropertyChangedSignal("Text"):Connect(onEnterWordsChanged)
onEnterWordsChanged() -- call the function so initial value is printed
Sorry I didn’t reply, I went offline. However, even after trying this it still didn’t work, I have no idea why. This is why I am debating whether it is a bug because when I put this exact code with the script being a child of the TextBox, it works perfectly. Also, I tried using the :Changed event instead but the only thing that it did was just print three or four times.