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

What's wrong with my script? Character Images Problem?

Asked by 7 years ago

local Player = game:service('Players').LocalPlayer local charID = 'http://www.roblox.com/thumbs/avatar.ashx?x=352&y=352&format=png&username=%s';

script.Parent.MouseButton1Down:connect(function() script.Parent.MainScreen.OvO.Player1.Image1 = charID:format(Player.userId); end)

Function is, when i leftclick down, a character image will appear in Image1, but i dont see what is the problem here, maybe my local player is wrong?

1 answer

Log in to vote
0
Answered by 6 years ago

In order to get the player their image, there is a simple function for that called game.Players:GetUserThumbnailAsync()

And this is how you would use it (Example):

local player = game.Players.LocalPlayer

script.Parent.Image = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)

The format of the function is like this: game.Players:GetUserThumbnailAsync(userID, ThumbnailType, ThumbnailSize)

I hope this helped for you.

Ad

Answer this question