How to check if text has been pasted into a textbox?

I’m looking for something like: TextBox.TextPasted:Connect()

There is no specific way, but you could check through a changed event and check if the length difference is greater than one.

local prevtext = ""
local textbox = --textbox

    if string.len(textbox.Text) - string.len(prevtext) > 1 then
    prevtext = textbox.Text

There is also a way of checking if the user is pressing ctrl+v simultaneously, but it would require many more checks and I figured this way was better.

1 Like
local Game = game
local UserInputService = Game:GetService("UserInputService")
local Script = script
local TextBox = Script.Parent

local function OnInputBegan(InputObject)
	if not (TextBox:IsFocused()) then return end
	if InputObject.KeyCode.Name == "V" and (UserInputService:IsKeyDown("LeftControl") or UserInputService:IsKeyDown("RightControl")) then
		print("User pasted the contents of their clipboard.")


You can also use ‘C’ to detect when text is copied to the clipboard (inside of a ‘TextBox’ instance).

I know this was a while ago, but this isn’t accurate.