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

Does anyone know how to make this auto fill text box?

Asked by 4 years ago
Edited 4 years ago

https://prnt.sc/stz86f

1 answer

Log in to vote
0
Answered by 4 years ago

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.

0
Thanks! That should help! FireSam5163 22 — 4y
Ad

Answer this question