So I want a textbox’s text to equal the text of a textlabel. I tried doing it, but everything doesn’t work. Please help!
My code:
local TextBox = --textbox location
local TextLabel = --textlabel location
TextBox:GetPropertyChangedSignal('Text'):Connect(function()
TextLabel.Text = TextBox.Text
end)
ShyFlooo
(Flo)
September 6, 2021, 5:05pm
#2
Try put the script inside a Local Script (if you haven’t already)
I have, and it doesn’t work at all.
ShyFlooo
(Flo)
September 6, 2021, 5:10pm
#4
Did you maybe set the local TextBox
to the TextLabel?
Because If I try it inside a Local script it works fine
Did you try something like this?
local TextBox = --location
local TextLabel = --location
TextBox.FocusLost:Connect(function()
TextLabel.Text = TextBox.Text
end)
Are you sure you have the TextBox and TextLabel locations correctly? if yes what error are you getting in the output?(if there is any)
ShyFlooo
(Flo)
September 6, 2021, 5:18pm
#7
If he have the TextBox and TextLabel located wrong there is not going to be an error because both got the Text Property.
But yes I think that’s his problem
Not_1yo
(Not_1yo)
September 6, 2021, 5:18pm
#8
Try flipping it
textbox.text = textlabel.text
also have you tried .Changed function?
He might have added a .Text already to the variables, so although he might think the location is correct he would still get an error.
Uzixt
(Uzi)
September 6, 2021, 5:24pm
#10
how are you assigning the location? I feel like you’re referencing the StarterGui instead of the PlayerGui
I’ve tried remaking your code and it works as it should. As @MCNightwatcher said, are you sure you assigned the variables in the right location? Can you send how you actually assigned it?
Nope! I am using script.Parent, and not game.StarterGui