Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't 'GetPropertyChangedSignal' work correctly?

Asked by 4 years ago
Edited 4 years ago

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.

0
do you have a string value? JesseSong 3916 — 4y
0
Well are you even changing the text thatwalmartman 404 — 4y
0
Yes, I will be changing the text when typing in game, but nothing happens. RyanTheLion911 195 — 4y
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 kingblaze_1000 359 — 4y
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? killerbrenden 1537 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

0
Nothing, doesn't do anything. RyanTheLion911 195 — 4y
0
Well then I am confused. The version you did works for me all the time kingblaze_1000 359 — 4y
0
Yeah, I don't understand why it doesn't work either, it's frustrating. RyanTheLion911 195 — 4y
Ad

Answer this question