Copy Text to Keyboard

– Old Post – Nothing here reflects the way I program today.

Is it possible to copy some text through Roblox Studio? (For example, a button that when clicked makes some text go to your keyboard).

1 Like

It’s a pretty broad question , it could :
mean detecting input and setting a key to perform an action
or simply pressing CTRLH in the script and searching for text such as rbxassetid://ID and deleting it from wherever it is in the script.

1 Like

As far as I know, this is not currently possible. There have been feature requests for it

1 Like

I’m not sure if Roblox has that feature yet. Pasting is something we can already do, but copying text to clipboard from a running Roblox game, not so sure.

There are topics like below, which are just suggestions, so you can give it a like if you want the feature.

Please be more specific on how you want to “get rid of such piece of text”. Where do you want it to get rid of from? A text label gui or a script?

If in a script, you can go use one of the features in the Lua string library that cuts that specific part of your string. Click this documentation for reference.

1 Like

To get part of a string you could use string.Sub like :

local str = "rbxassetid://213124124" 
  local sub = string.sub(str,14)--to extract everything after the 14th character
 print(sub)--Output -----> the id (213124124)

Format = ( string s, string i , string j )
That will basically get all characters starting at i (14)
if you leave out j then it will get all characters from i till j (which is -1 , and equates to the length of the string)

so this code :

print(string.sub (str , 14 , -1) ) ----> will give the same Output.

A better way to do this would be to use string patterns and match from the first number until the next character is either nothing or not part of the pattern. This gets rid of the necessity to rely on how many characters rbxassetid is.

local str = "rbxassetid://213124124"
local id = str:match("%d+") -- Get first and all subsequent numbers
print(id) -- 213124124

As for @Woesus, in terms of copying from Studio to the keyboard, no Roblox does not currently allow this and there are no methods for doing so.

2 Likes