How would I make a Textbox change text in a script and what i mean by that is If you had a Textbox on a gui and when you press a textbutton any thing that you typed in there will print into the console or something
COMMUNITY QUESTION
How do I make a Textbox change text in a script?
1 answer
Use a LocalScript and connect the MouseButton1Click property of the TextButton to a function that prints the contents of a TextBox.
Example object hierarchy:
StarterGui
ScreenGui
TextButton, TextBox, LocalScript
Example LocalScript:
local box = script.Parent.TextBox
local button = script.Parent.TextButton
button.MouseButton1Click:Connect(function()
print(box.Text)
end)
1 comment
1
here so u get 200
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
We need an attempt.
You just do [textbox.Text = "Your string"] I can only assume your issue is the TextBox only exists on the client because it was created locally, in that case you need a LocalScript to handle the change (which is advisable to have either way)