Textbox.Text not working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I wanna use textbox by acessing the .Text property

  2. What is the issue? TextBox.Text = nil

  3. What solutions have you tried so far? Well On the dev forum the problom is solved for everyone else,The Local is in a function like this

script.Parent.Parent.TextButton.MouseButton1Click:Connect(function()
	local text = script.Parent.Text
Print(text) --nil

Yeah

1 Like

Found a typo, it should be print(text) not Print(text).
Here’s an Error example.
image

No That’s just a typing typo,But print() still dont work

Try this…

script.Parent.Parent.TextButton.MouseButton1Click:Connect(function()
    print(script.Parent.Text)
end)

Still not working it still print nil ive typed some random stuff into text box but still it dont work

The reason why your script doesn't pick up the text in TextBoxes is because TextBox input is client-sided.
Try changing your script to a LocalScript.

In which textbox so you have a Button that u press and if it get pressed it should pick up the text of the button or the textbox and if its the textbox is it in the same GUI?

Can you send me a screenshot of the location of the text button in explore, I think seeing where it is located might help me out with understanding how to help you.

This is solved,The textbox.text must be getted locally

1 Like