Is local string auto detect (not StringValue Instance)
I give an example
local str = “”
TextBox.GetPropertyChangedSignal(“Text”):Connect(function(newText)
str = newText
end)
TextLabel.Text = str
Is it auto change the text label too?
Is local string auto detect (not StringValue Instance)
I give an example
local str = “”
TextBox.GetPropertyChangedSignal(“Text”):Connect(function(newText)
str = newText
end)
TextLabel.Text = str
Is it auto change the text label too?
I’m not completely sure what you are asking here?
But I do see one issue:
The .GetPropertyChangedSignal needs to have a ‘:’ starting instead of ‘.’ as it is not a property of the text box.
So instead of TextBox.GetPropertyChangedSignal() it should be TextBox:GetPropertyChangedSignal()
Im not sure what do you want to achieve, anyways :GetPropertyChangedSignal() can only be used for instances properties. is the function of an “instance”.
Also if you want more info about this you should check the API reference.
https://developer.roblox.com/en-us/api-reference/function/Instance/GetPropertyChangedSignal
Yes so i have like this textlabel that the text is a local string, without using stringvals, so whenever the string change does the textlabel automatically change too?
For some reason, GetPropertyChangedSignal doesn’t provide an argument (newText). You have to manually index it:
local str = ""
TextBox:GetPropertyChangedSignal("Text"):Connect(function()
str = TextBox.Text
end)
TextLabel.Text = str
No it won’t.
You have to manually put TextLabel.Text = "YOUR_STRING" in order for the text to update.
If you would like to detect when the TextLabel text changes, do:
local TextLabel = script.Parent -- Or whatever your location was for the TextLabel
TextLabel:GetPropertyChangedSignal("Text"):Connect(function()
-- Do whatever you want to do
end)