✓ ANSWER ACCEPTED
Does anyone know how to make this auto fill text box?
1 answer
✓ Accepted answer
Seems like you want to autocomplete player names?
If you have some string that you want to autocomplete to a list of player names, you can see which player names match like so:
function getPartlyMatching(searchString, list)
local result = {}
for _, item in pairs(list) do
local itemName = tostring(item)
if string.find(itemName, searchString, 1, true) then
table.insert(result)
end
end
return result
end
Look up the docs for string.find if that part doesn't make sense to you.
You can then generate a GUI list that shows every matching player, which a button that players can click to automatically fill in the search box.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks! That should help!