I am on the verge of making my own player list and got almost got it to work. The local script is:
local PlayerService = game:GetService("Players")
local players = game.Players:GetChildren()
local ImageLabel = script.Parent
while true do
wait()
local PlayerName = players[2]
print(PlayerName)
local PlayerId = PlayerService:GetUserIdFromNameAsync(PlayerName)
print(PlayerId)
local ThumbType = Enum.ThumbnailType.AvatarBust
local ThumbSize = Enum.ThumbnailSize.Size420x420
local Content, IsReady = PlayerService:GetUserThumbnailAsync(PlayerId, ThumbType, ThumbSize)
ImageLabel.Image = Content
end
This gets the second player and grabs their user id from their name. However, it fails on line 8 and gives me the error
23:09:23.443 - Argument 1 missing or nil
What's wrong with this?

19 comments
I'll give it a shot
It works for player 2 but not player 1
Which method?
The repeat wait() until one
o sorry lemme reedit i made a typo
Ok so that happens because when the second player joins, it adds to the array, so it will always become the second player
so how can I battle this?
i got an idea but lemme ask you one thing, does it matter if its the second player or any player?
Any player for all the gui's (it's a playerlist [it changes])
so any random player will work?
I need to get all the players and put them in these guis (so the order doesn't matter just that there is no duplicates and all are included)
Basically, you want the script so that the player would see the other player's profile picture?
Absolutely!
what if theres three players? or more?
I'm trying to make these local scripts in the gui so it replaces an image for the every player's number under a picture(there is several)
so any random other player that is not yourself?
yes
ok first of all, you need to put alot of details to your question because this comment section is wayyyy too long, second of all, I'll re-edit the answer so it has what you need.
ok go check