Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I know if the player copied text?

Asked by 2 years ago

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

Log in to vote
1
Answered by 2 years ago
Edited 2 years ago

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

0
I figured it out myself. MiAiHsIs1226 189 — 2y
Ad
Log in to vote
0
Answered by 2 years ago

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.

Answer this question