> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# setclipboard

Sets the user's OS clipboard to `value`.

```luau theme={null}
setclipboard(value: any): ()
```

The clipboard is OS-visible, so a paste anywhere outside Roblox shows what got written. The function does not enforce a type on `value` - a `string` lands in the clipboard raw, while a `number`, `table`, or `nil` value is coerced and prefixed with a carriage return byte (`\r`).

Personally? I use it to redirect users to a Discord server, or to copy my HRP's position to hardcode the value into an autofarm script.

## Parameters

| Parameter | Type  | Description                          |
| --------- | ----- | ------------------------------------ |
| `value`   | `any` | The value to write to the clipboard. |

## Returns

<code title="the function does not return a value.">void</code>

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  setclipboard("text to copy")
  =======
  -- setclipboard(value: any): ()
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  local hrp = cloneref(game:GetService("Players")).LocalPlayer.Character.HumanoidRootPart
  local c = table.pack(hrp.CFrame:GetComponents())
  setclipboard(`CFrame.new({table.concat(c, ", ")})`)
  ```
</CodeGroup>

<Tip>
  Allows users to easily copy URLs, keys, or coordinates from script outputs.
</Tip>
