Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why doesn't 'GetPropertyChangedSignal' work correctly?

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 TextButton. I want to use the 'GetPropertyChangedSignal' event to get the text of the TextButton 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.

https://gyazo.com/99fc5b7bea0e8f4c402ce15fc80be8f6

ALL IN A LOCAL SCRIPT

Here is the code that I have been using:

local EnterWords = script.Parent.EnterWords

EnterWords:GetPropertyChangedSignal("Text"):Connect(function()
	print(EnterWords.Text)
end)

I can't tell whether I'm making a simple mistake because I can't see why this won't work. I will accept your answer if it works.

Edit: Even if I do:

print(game.Players.RyanTheLion911.PlayerGui.randomWords.EnterWords.Text)

nothing prints out, even though the TextButton has text.

5 comments

0

do you have a string value?

0

Well are you even changing the text

0

Yes, I will be changing the text when typing in game, but nothing happens.

0

You can't change the text unless it is a textButton or you're changing it from lines of code. TextButtons do not have the TextEditable value

0

You could put a StringValue inside of the TextButton with a LocalScript and always set the text of the TextButton to the value of the StringValue and use :GetPropertyChangedSignal("Value") on the StringValue?

1 answer

That looks right to me, but maybe try this:

local EnterWords = script.Parent.EnterWords

EnterWords:GetPropertyChangedSignal("Text"):Connect(function(text)
    print(text)
end)

I'm not quite sure this will work but it's worth giving a try

Edit: Btw text buttons don't have a TextEditable value. That only comes with TextBoxes

3 comments

0

Nothing, doesn't do anything.

0

Well then I am confused. The version you did works for me all the time

0

Yeah, I don't understand why it doesn't work either, it's frustrating.

This discussion is preserved as it was. New answers, comments, and votes are closed.