Volt

setclipboard

Copies text to the system clipboard.

Syntax

setclipboard(text: string) -> void

Aliases

  • toclipboard
  • setrbxclipboard

Parameters

ParameterTypeDescription
textstringThe 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

On this page