Sorry if the title was confusing but what I have right now is when the user types a letter it trys to autofill using a string of words I give it. But once you type one letter it tryes to autofill and what I need is for it to wait till you type 2 or 3 letters before autofillings. Here is my code:
local SearchBar = script.Parent
local commands={"HelloPlayer","HelperBot","ExampleList"}
local EnterOpen = false --If the notification saying press eneter to autofill is on screen.
SearchBar:GetPropertyChangedSignal("Text"):Connect(function()
local PartialName = SearchBar.Text
local foundtarget
for i = 1, #commands do
local Command = commands[i]
if string.lower(Command):sub(1, #PartialName) == string.lower(PartialName) then
foundtarget = Command
if EnterOpen == false then
script.Parent.Parent.Frame.Visible = true
EnterOpen = true
end
--SearchBar.Text = Command
break
end
end
-- use foundPlayer variable to do the other stuff
end)
Thanks!