There is a function for this, but it is locked to core scripts so it is unusable. As an alternative to copying the text to clipboard, you can have a texteditable false textbox with the text you want them to copy and they could copy it.
1 Like