How to make a button copy to clipboard

I want to make a game, a button can copy some text, But I don’t know how to make a button copy to clipboard, who can help me?

2 Likes

I am afraid that, currently, there are no plans to expose the player’s clipboard as a Lua API. If you want to let the player copy paste something, you’re gonna have to make a text box, focus it, and then from there you can just tell them to press Ctrl+C which is the shortcut for copying.

1 Like

But, I see some game can do it.

I forget what name is the game

1 Like

It isn’t possible, no games have such functions, it would be impossible to manipulate a player’s device through a game with Roblox’s Lua API.

Its not possible that the text is copied to the device, but you can make your own module that saves the copied text to be used within the game. And use UIS for the keybinds, CTRL + C and CTRL + V

3 Likes

Good idea, couldn’t have thought of that. Good stuff.

2 Likes

You can use setclipboard to set to clipboard
setclipboard(“Your Text”)

doesn’t work, only some executors have that capability

Found the synapse user. Get outta here, bud.

2 Likes

lol ye, these people exposing themselves. Found another topic the same as this one which was marked as solved for the same answer. For those who do not know, setclipboard() is not a valid method and will just give you an error in Roblox studio. Don’t try, It isn’t even worth trying.

1 Like

For what i remember i think GuiService contain Copy to clipboard thing. But i am not 100% sure

As I know, there’s no any ways to do this

Hello, You can use the textbox as a copy to clipboard, it may not be advance but i assume that BedWars uses this to copy the username of the player on the TabList.

  1. Create A TextBox
  2. Open the properties of the Textbox
  3. Set the TextEditable = false

Then customize on however you prefer

If you want something like copy the player username here is an example code:

image

Here is the example code:
image

Make sure to turn to false on the TextEditable on the properties of the TextBox