Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

player.UserId headshot image endpoint?

I want to get an image of the player's head using the endpoints here.

Not sure how to link a player to the endpoint, as I just keep getting a basic Roblox user headshot instead of my own. The localScript needs to link to the player currently in the game (1plr game)

My code:

local player = game.Players.LocalPlayer

script.Parent.Image = "https://www.roblox.com/headshot-thumbnail/image?userId=1&width=420&height=420&format=png" .. player.UserId

Thanks, -Mex

3 answers

✓ Accepted answer

You're supposed to change the userId query object:

local player = game.Players.LocalPlayer

script.Parent.Image = "https://www.roblox.com/headshot-thumbnail/image?userId="..player.UserId.."&width=420&height=420&format=png"

1 comment

0

He beat me ;)

local player = game.Players.LocalPlayer
	 
script.Parent.Image = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. player.userId .. "&width=420&height=420&format=png"

You have not placed the right location for the UserId. you should put it in half, not in the end. here is your fixed script:

local player = game.Players.LocalPlayer

script.Parent.Image = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. player.UserId .. "&width=420&height=420&format=png"

Hope it helped :D

This discussion is preserved as it was. New answers, comments, and votes are closed.