I am quite new to scripting, and found nothing on this online.
COMMUNITY QUESTION
How do I make a TextBox change its text once a TextButton is pressed?
1 answer
Connect a function to the event that is fired upon the button being clicked, which will set the text.
We'll use the following:
MouseButton1Clickevent ofTextButton. See in the docs
Textproperty ofTextBox. See in the docs
Like so:
-- Connect a function to the event, so that it will run every time the event fires
YourButton.MouseButton1Click:Connect(function()
YourTextBox.Text = "Whatever text you want here" -- Set the Text property, changing the text shown
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
