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

How can I detect if there's text and textbox is focused so I can tween a textlabel?

Asked by 2 years ago
Edited 2 years ago
ts = game:GetService('TweenService')

if script.Parent.Text ~= "" then
    ts:Create(script.Parent.Parent.UserText, TweenInfo.new(0.05), {TextSize = 12}, true):Play()
    ts:Create(script.Parent.Parent.UserText, TweenInfo.new(0.05), {TextColor3 = Color3.fromRGB(33, 197, 229)}, true):Play()
    script.Parent.Parent.UserText:TweenPosition(UDim2.new(0.185, 0,-0.08, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 0.2, true)
elseif script.Parent.Text == '' and script.Parent.Parent.Username.FocusLost then
    ts:Create(script.Parent.Parent.UserText, TweenInfo.new(0.05), {TextSize = 14}, true):Play()
        script.Parent.Parent.UserText:TweenPosition(UDim2.new(0.145, 0,0.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 0.2, true)
end

I made this but it's not working and didn't print any errors

1 answer

Log in to vote
0
Answered by 2 years ago
UserInputService.TextBoxFocusReleased:Connect(function(TextBox)

and you can use TextBoxFocused

0
https://uploadi.ng/pYzHgqsM is this what u mean't? Luna_SyntaxYT 8 — 2y
0
should work User#31501 0 — 2y
0
but it doesn't :( Luna_SyntaxYT 8 — 2y
Ad

Answer this question