setClipboard | Multi Theft Auto: Wiki Skip to content

setClipboard

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function sets the players clipboard text (what appears when you paste with CTRL + V)

Syntax

setClipboard ( )

Code Examples

client

This example adds a command called clipboard which lets you set your clipboard text.

addCommandHandler( "clipboard", -- add a command handler for the command
function( command, ... )
local text = table.concat({...}, " ") -- if the text has spaces this will turn it into a string
local success = setClipboard( text ) -- set the clipboard and find out if it worked
if success then
outputChatBox( "Clipboard text set to: " .. text, 0, 255, 0 ) -- if it did, tell the player
else
outputChatBox( "Failed to set the clipboards text", 255, 0, 0 ) -- if it didn't, tell the player
end
end
)