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

Why is this not working correctly? (Player Picture).

game.Players.PlayerAdded:connect(function(player)
local image = script.Parent.SurfaceGui.Frame.ImageLabel
image.Image = http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=player
end)

2 comments

0

You didn’t wrap line 3’s Image in quotes.

0

Edited!

2 answers

###This is because of line 3. You assigned the Image, but didn’t wrap the link in quotes. To fix this:

##Line 3:

image.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username="..player.Name

3 comments

0

Nope.

0

I thought it worked, but it didn't, I noticed I didn't get player name, BUT When I changed it to get playername it still doesn't work.

0

Didn't work.

Instead of doing

image.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username="..player.Name

Do this (Executed from a local script)

local getplayer = game.Players.LocalPlayer

script.Parent.Image = game.Players:GetUserThumbnailAsync(getplayer.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
-- // Format: (UserID, ThumbnailType, ThumbnailSize)
-- // script.Parent.Image will be your image.

You can fool around with the settings if you want to.

Make sure to assign or create an imagelabel first.

6 comments

0

Can you explain how line 3 works, I'm really confused.

0

Didn't work either.

0

Maybe the player could be undefined. If you use a wait(0.1) at the top of the script it could work.

0

Still not working, and I'm getting 0 outputs.

0

That's wierd..

0

It's inside an image label....

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