Nevermind. It wouldn’t work.
Anyway, try placing an invisible part inside of lighting, and name it “”. Use it’s name instead of “”
I’ll try swapping the sequence so it captures focus after changing to an empty string
I’ll update this post if it worked
(This infact, did not work)
It will remain the same if CaptureFocus()
add a blank when called.
That would just make the string ‘“”’
and I don’t think it’s possible to name a part an empty string
The main problem is that CaptureFocus()
adds a space as the first character, but setting the text to “” does not remove this first space as there is no text. Therefore, you need to use a workaround with a text label instead or consider not using CaptureFocus()
at all.
Imma be honest, I probably wont find a solution to this, I’ll have to use some weird workaround.
It’s probably inserting a carriage return "\r"
or "\13"
when you’re pressing the Enter.
Put a task.wait()
before the CaptureFocus
.
textbox.FocusLost:Connect(function(enterp: bool)
if not enterp then
return
end
task.wait()
textbox:CaptureFocus()
textbox.Text = ""
end)
Also I did some testing and both the PlaceholderText and the cursor will appear.
existing question
tostring(nil) returns “nil”
characters
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.