Example: The player's name is "lolnuub0204" and i only typed "lol." How would i make a script that finds "lolnuub0204" from just "lol"?
This function will return a table of all players that match the search query.
findMatches = function(Query) local Matches = {} for i, v in pairs(game.Players:GetPlayers()) do if string.sub(string.lower(v.Name), 1, #Query) == string.lower(Query) then table.insert(Matches, v) end end return Matches end for i, v in pairs(findMatches("lol")) do v.Character.Humanoid.Health = 50 end