Categories > Exploiting > Scripts >

[Help] Problem with FocusLost with textboxes

OwlGuru

Gaming LV

Posts: 25

Threads: 15

Joined: Sep, 2021

Reputation: 0

Posted

Hello, I am making a custom UI library and I have a problem with the FocusLost function. So I don't know how to get text when focuslost on the textbox. Here is my code:

-- Add text box
function OranguLib:AddTextBox(text)
        local TextBox = Instance.new("TextBox")
		local callback = callback or function() end
		
        TextBox.Parent = Container
		TextBox.BackgroundColor3 = Color3.fromRGB(34, 34, 34)
		TextBox.BorderColor3 = Color3.fromRGB(255, 170, 0)
		TextBox.Size = UDim2.new(0, 200, 0, 50)
		TextBox.Font = Enum.Font.SourceSans
		TextBox.PlaceholderColor3 = Color3.fromRGB(117, 117, 117)
		TextBox.PlaceholderText = text or "Default placeholder"
		TextBox.Text = ""
		TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
		TextBox.TextSize = 14.000

		TextBox.Focused:Connect(function()
			TextBox.BorderColor3 = Color3.fromRGB(41, 255, 41)
		end)
		
		TextBox.FocusLost:Connect(function() -- doesnt work
			TextBox.BorderColor3 = Color3.fromRGB(255, 170, 0)
			pcall(callback, text)
		end)
    end

main:AddTextBox("Print Text", function(input) -- doesnt print input
    print(input)
end)
  • 0

Added

@_realnickk Doesn't work sadly, it doesn print anything when focus is lost. Any ideas why?

  • 0

I play minecraft and sometimes roblox with cheats

Posts: 1430

Threads: 71

Joined: May, 2022

Reputation: 20

Replied

pcall(callback, text)() --use () at the end

  • 0

i use arch btw

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )