Player Thumbnail not working

Hey guys! I’m currently very stuck and unable to progress due to an issue; i’m unable to get the player’s thumbnail. Here’s my local script for it:

local UserId = game.Players.LocalPlayer.UserId
print(UserId)
local ThumbType = Enum.ThumbnailType.HeadShot
print(ThumbType)
local ThumbSize = Enum.ThumbnailSize.Size150x150
print(ThumbSize)
local content, isReady = Players:GetUserThumbnailAsync(UserId, ThumbType, ThumbSize)

It prints correctly:
11:03:16.355 1218873427 - Client - HomePageManager:18
11:03:16.355 Enum.ThumbnailType.HeadShot - Client - HomePageManager:20
11:03:16.356 Enum.ThumbnailSize.Size150x150 - Client - HomePageManager:22

However, it returns this error later on:
“attempt to index nil with ‘GetUserThumbnailAsync’”

I’ve published the game to roblox and enabled studio access to api issues. Can anyone assist me on the issue? Any help is appreciated!

Did you forget to make a Players variable? It’s seeing Players as nil, judging by your code, I think you meant to do game.Players, which I would recommend changing to game:GetService("Players")

1 Like

Thanks for your response! I tried this before, to no avail. I also tried it again right now, to the same result.