Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a button to click that changes the text of a label?

I don't know this, can you please help?

2 answers

✓ Accepted answer

Simple. Set up a function that activates from a click of a GUI button and then change the text of the label with .Text = string

function foo()
	local label = screengui.textlabel
	label.Text = (string)
end

button.MouseButton1Click:Connect(foo)

Obviously create the appropriate variables for the object. I have set it up so you have to write it down rather than copy and paste. It is rather simple and a quick Wiki search on GUIs and buttons could help explain in detail of what I did not cover because it is a lot.

Hello NintendoMinecraftKid. Do you know how to make a UI? You need a ScreenGui put in StarterGui. If you know that, I can help you.

Just put a TextButton on this ScreenGui and put a LocalScript on this button and write that

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Text = 'Hello new text!!' -- This is a string.
end)

Check the developer page to learn more.

For more question, put below in commentary.

This discussion is preserved as it was. New answers, comments, and votes are closed.