how do you make something like this? the username cannot be the localplayer's name and it finds for other players in the server https://gyazo.com/c2640da84e918f10782505e047fff53f
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.
