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

Player Images Not Loading?

Asked by 6 years ago

When I try to use player images (such as the headshot), it comes as blank or an error.

I've been using:

local plrid = script.Parent.Parent.Parent.Parent.Parent.UserId

script.Parent.Image ="http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&id="..plrid

How to avoid this?

1 answer

Log in to vote
0
Answered by
Jellyfosh 125
6 years ago

It has to be a problem with how you define "plrid". Since you're working with Guis I'll assume you're using a LocalScript(which you should!). Remember that you can always use LocalPlayer, like this:

local plrid = game:GetService("Players").LocalPlayer.UserId

script.Parent.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&id="..plrid
0
When I use LocalPlayer, it always come as a nil value, so I don't normally use it. WaddelsG 69 — 6y
Ad

Answer this question