Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a auto-username filler (or shows you what the entire username is?)

1 answer

This code can help you!

function findUser()
    local players = game.Players:GetPlayers()
    local text = NameOfTextBox.Text
    local matches = {}

    for i, Player in ipairs(players) do
        local name = Player.Name
        local term = string.sub(name, 1, string.len(text))
        
        local match = string.find(term, text)

        if match then
            table.insert(matches, name)
        end
    end
    
    -- If we don’t have multiple matches , do stuff
    if not #matches > 1 then
        NameOfTextBox.Text = matches[1]
    end

    
end

This discussion is preserved as it was. New answers, comments, and votes are closed.