Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I know if the player copied text?

So I need help on knowing if a player copies text

I use UserInputService but it didn't work

Can anyone help me?

if UIS:IsKeyDown(Enum.KeyCode.C) == true and (UIS:IsKeyDown(Enum.KeyCode.RightControl))  then
		print("The Player copied text!")
	end

2 answers

✓ Accepted answer

https://developer.roblox.com/en-us/api-reference/class/UserInputService

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(keyPressed, other)
	if other then return end -- if typing then stop script (remove if u want)
	if keyPressed.UserInputType == Enum.UserInputType.C then --- checks to see if they pressed c
		if UserInputService:IsKeyDown(Enum.KeyCode.RightControl) then -- idk what right ctrl is (this checks to see if right ctrl is still down)
			print'copied'
-- finish script with ends

1 comment

0

I figured it out myself.

I found the reason It's exactly what BulletproofVast said

If you're wondering why I asked for this please continue reading

I am trying to create a Copy to clipboard script (without using copytoclipboard)

This script has successfully worked, however this cannot work outside roblox, it can only work on the TextBoxes inside roblox.

Here is the proof.

If you wish for me to release it I gladly will do!

Now please just vote this question up.

This discussion is preserved as it was. New answers, comments, and votes are closed.