setclipboard
Copies text to the system clipboard.
Syntax
setclipboard(text: string) -> voidAliases
toclipboardsetrbxclipboard
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | The text to copy |
Returns
This function does not return a value.
Description
setclipboard copies the provided text to the system clipboard, allowing it to be pasted elsewhere.
Example
-- Copy a simple message
setclipboard("Hello, World!")
-- Copy player information
local player = game.Players.LocalPlayer
setclipboard(player.Name .. " - " .. player.UserId)
-- Copy a table as JSON
local HttpService = game:GetService("HttpService")
local data = {name = "Player", score = 100}
setclipboard(HttpService:JSONEncode(data))Notes
- Works with any string data
- Useful for copying large amounts of data
Related Functions
identifyexecutor- Get executor info