How to make text that you can select

Have you ever wanted to show a link in game, or show a code, but you dont want players to have to re-type out the code or whatever, well do I have a solution for you!

How to make text so you can select it, and then copy it!

    1. Create a TextBox
    1. Feed me
    1. Set the textboxes TextEditable property to false
    1. Set the textboxes ClearTextOnFocus to false
    1. Set the text of the textbox to whatever you want

and boom, as easy as that you can now select the text in the text box! Its really that easy lol

Example

If you have any questions feel free to ask!

4 Likes

If ya wanna know something also pretty cool, select/highlight on click!

local textboxy = --pathway!

textboxy.Focused:Connect(function()
	textboxy.CursorPosition = #textboxy.Text + 1
	textboxy.SelectionStart = 1
end)

local script btw :d

2 Likes