Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
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)
0
You didn’t wrap line 3’s Image in quotes. User#19524 175 — 5y
0
Edited! User#19524 175 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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
0
Nope. Twenty1chickens 4 — 5y
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. Twenty1chickens 4 — 5y
0
Didn't work. Twenty1chickens 4 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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.

0
Can you explain how line 3 works, I'm really confused. Twenty1chickens 4 — 5y
0
Didn't work either. Twenty1chickens 4 — 5y
0
Maybe the player could be undefined. If you use a wait(0.1) at the top of the script it could work. iiSxnic 5 — 5y
0
Still not working, and I'm getting 0 outputs. Twenty1chickens 4 — 5y
View all comments (2 more)
0
That's wierd.. iiSxnic 5 — 5y
0
It's inside an image label.... Twenty1chickens 4 — 5y

Answer this question