Im trying to make admin commands that uses shortcuts to find player but its giving error whenever I try to execute command. Heres script:
function findPlayer(victim)
for i,v in pairs(game.Players:GetChildren()) do
if #victim < 3 then
print("Need more characters than 3 to find player.")
else
local lowname = v.Name:lower()
if lowname:sub(1,#victim) == victim then
if #v > 1 then
print("Enter more characters to find one player.")
else
return v.Name
end
else
print("Could not find existing player.")
end
end
end
end

6 comments
Im trying to get player count not name's long
#player:GetPlayers()will return the number of players ingameI want to get v's count
He literally answered your question.
nope
bruh