So I have an admin command script, it works fine, but its a pain typing out the entire username of a player to do a command, I want the effect admin scripts such as Kohl's have, where a player can be found just from the start of their username
local function findplayer(name)
for _,player in pairs(game.Players:GetPlayers()) do
if string.lower(player.Name) == name then
return player
end
end
return nil
end
This is the current function that finds the player, anyone know how I can edit it to make this possible?

1 comment
Thanks! this did the job