I’m trying to put the local player’s Roblox profile picture on a SurfaceGui. Though, it seems to be very different from putting it on a GUI. I’m not quite sure where to start but this is just a non-functional code example of what I’m trying to do:
local thumb = game:GetService("Players"):GetUserThumbnailAsync(game:WaitForChild("Players").LocalPlayer.UserId)
script.Parent.Image = thumb
Let me know if you have any questions. Thanks!
Note:
I’m a builder, not a scripter. I’d love to hear explanations on how these things work as I’m trying to learn! (if possible) Thanks!
No, it’s a local script. However, I’ve tried these exact scripts many times and none of them have functioned except for when I’ve used them to create a ScreenGui.
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local thumb = Players:GetUserThumbnailAsync(Player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
if thumb then
game.Workspace:WaitForChild("PartWithSurface"):WaitForChild("SurfaceGui"):WaitForChild("ImageLabel").Image = thumb
end
But, I think the approach would depend on whats the purpose for this, like, each player has its own surface gui? why showing the player picture on that part? is a winner of something?
Make sure it isn’t inside the workspace, as LocalScripts do not normally work in the workspace if you want to use LocalScripts within the workspace, I recommend looking into RunContext. (it wont Direct to the Proper Method)
Put the SurfaceGui inside StarterGui, and Adorne (NOT PARENT), the UI to the Part, then you can use LocalScripts