Clipboard Access

We’ve had a couple of threads about this in the past, but every time it was pointed out that there were security issues with the suggestion. Here is a suggestion free of security issues:

SetClipboard(string/object or array of those)

The premise of these API members is that they avoid getting the clipboard directly because god forbid some dunce out of the millions of people on ROBLOX copies his password to his clipboard and a script could steal it. Another issue brought up was phishing where users are told to paste a link into their browser, but that’s as much non-issue as a non-issue can get. Phishers can also tell users to manually type a link into their browser. So the suggested API members are security-issue free.

I don’t want to make them members of plugin because then we can’t use them in-game. What if I want the user to be able to copy someone’s username out of my game and then search for them on ROBLOX? I’m not sure where the best place for these methods and event would be, but it’d be great if it were something that could be used in-game.


Not sure I’d be cool with a game setting my clipboard without my permission… especially if they "SetClipboard("")" or some other bs like “Follow me on Twitter @blahblahblah

I just don’t trust the Roblox community with something like that


In a live game how useful is it to copy instances to the clipboard? Maybe two versions would be better, one where you copy a string to the clipboard and another for objects. The one with objects is usable for plugins, the one with string for both plugins and clients.

Also, maybe it could have a confirmation dialog or alert (like friend request/badge get/etc) when something is copied to the clipboard.


Blaring dank meme audio into the speakers when someone joins a game is abuse but we have audio anyway
Loop teleporting me across multiple places is abuse but we’re able to teleport players without confirmation anyway
Locking the mouse to the center of the screen prevents the user from exiting the game without using Esc and can be abused, but we have that functionality anyway

I could go on days listing all of the ROBLOX features that can be abused but were implemented anyway because they were useful. Your priorities are backwards if you’d give more weight to something that affected you so little and so rarely over all of the uses clipboard access has. Don’t play games that are clickbait or over 50% downvoted and you won’t even see that happen.

Not very (at least with what I can think of). Your suggestion for two versions sounds fine.

Reason? I’d shoot myself in the eye if my browser gave me a push notification whenever I copied something to the clipboard – I don’t see how it’d be any less irritating on ROBLOX.

I mean only for a live game for that last one, so that you as a player always know when something is being copied to your clipboard. (since the game could call it at any time without the player having to hit a key combination)

You’re designing things around edge cases at that point. Games that abuse features (blaring audio, spamming purchase prompts, etc) don’t get popular and the amount of people their abuse affects is minimal. Even in-game I don’t want to be told what’s copied to my clipboard by a push notification – the game should use the clipboard how I expect it to, and if it doesn’t, chances are I’m not going to be playing it in the first place.

I can quit the game to stop the audio or if the game is spamming me with dialogs, but the clipboard changes linger even when I leave the game, that’s what makes it different. Even if I’m playing a game that I’ll never play again after, I would like to be notified (or preferably asked for permission) if something in my clipboard was changed since this affects all applications (not just the ROBLOX client window).

ROBLOX can clear the clipboard if it was set whenever you exit the client then. Notifications for every time something so menial happens is overkill.

Clipboard(key) logger? :stuck_out_tongue:

Not funny, and no. There is nothing in the suggested API that allows directly getting the clipboard.

1 Like

Very unlikely that it’ll be allowed online.
The closest thing for online would be boolean(success) RequestSetClipboard(string).
(or, what buildthomas also mentioned: just allowing it and showing a notification)
We can already ctrl+v in TextBoxes, so not needed there. (this is still the case, right?)

What’s the difference between SetClipboard and AddToClipboard?
How can you add something to the clipboard? I only know ctrl+c.
But yeah, it would be quite useful for plugins in studio.

let’s think of selection for a second. When I do Selection:Set({part}), part is selected. When I do:

local currentSelection = Selection:Get()
table.insert(currentSelection, part)

part is added to the selection instead of being set to it. Due to “security” issues (a.k.a. dimwits who copy sensitive information like account passwords to their clipboard) we can’t allow access to Get directly, so we allow adding to the clipboard instead.

Or we could stop over-embellishing trivialities and there wouldn’t be an issue.

So the clipboard isn’t the actual OS clipboard?
I have no idea how AddToClipboard will be implemented…
(I mean, you could add one string to another string by concatting, but models? or a combination?)

The clipboard is exactly what it sounds like. You copy stuff from ROBLOX back to ROBLOX or another program. The API would be an interface between Lua scripts and the OS clipboard.

The triviality I mentioned was the issue where developers can copy malicious things to your clipboard. It’s as insignificant as insignificant can get because the most that can happen is “oh, I have something dumb on my clipboard” clears clipboard. And that’s also assuming that someone tries to paste something without first copying anything to their clipboard, which would be extremely rare.

Still no idea what AddToClipboard is.
If I do SetClipboard("abc") AddToClipboard("idk") what will be the result?

I’m for it. I think the security issues associated with it might be a little exaggerated. However, if we limit it to callbacks which are invoked when the user presses ctrl+v or ctrl+c, it would be safer. Then, the user would have to be actively pasting his password into ROBLOX, at which point I think any leaked password info is his/her own fault.

This would lead to an API such as the following:

local ClipboardService = game:GetService("ClipboardService");
ClipboardService.OnCopy = function(cut)
    --cut is true if ctrl+x was pressed, and false if ctrl+c was pressed.
    return "text";
    --value can be text, or if the value was cut from ROBLOX studio, it may be an instance.

I too don’t totally understand why we’d have AddToClipboard. It would be confusing for the user, because pretty much no software adds stuff to a clipboard.


Adding is intended for when I have a list of ROBLOX objects copied to my clipboard and I want to add another object to that list.
If you were sure the user had ROBLOX objects copied to their clipboard, you probably put them there in the first place and already know what they are. AddToClipboard would be pointless in this case. Removed from OP.

That’s the essence of ClipboardPasted that I had in the OP, but I’m not sure whether or not it’d be worth it for Ctrl+C. I could set a keybind in my game to Ctrl+C and then I have free reign to the user’s clipboard – it doesn’t stop the people who’d abuse it.

Setting the clipboard should be initiated by the user. The user should know what he’s getting.

  1. Implement a textbox that doesn’t suck.
  2. When focused, a user can press [shortcut] to copy highlighted text.