Hello Developers, how to put a player profile picture on a part and I choose the player in the script like example (put @roblox profile picture on script parent) if anyone know how can you tell me how and write a script if you can?
I’m not sure if I know what you mean. Try looking at this: How to get Profile Icon? - #8 by OverEngineeredCode
Give this a look over. You can use this function in conjunction with a BillboardGui to display Profile Pictures on Parts.
No like I want the script to put a player profile picture and I just type the player username like local player = @playerusername
I don’t understand, could you be more specific?
Ok so to do so First make a part with image label like this:
Then Make A Gui Like this with TextBox:
You can change the properties like you want but for reference do this:
Then a Local Script inside StarterPlayerScripts:
and At last script like this:
local Player = game.Players.LocalPlayer
local Gui = Player.PlayerGui:WaitForChild("ScreenGui")
Gui.TextBox.FocusLost:Connect(function(OnEnter)
if not OnEnter then return end
local PlayerUserId = game.Players:GetUserIdFromNameAsync(Gui.TextBox.Text)
if not PlayerUserId then return end
local Image
local success, errormsg = pcall(function()
Image = game.Players:GetUserThumbnailAsync(PlayerUserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
end)
if not success then
warn(errormsg)
return
end
if Image then
game.Workspace.Part.SurfaceGui.ImageLabel.Image = Image
end
end)
Result:
Mark Me Solution Please
sorry but I want to type the player username not the player type his username I want to type it in the script not in ui sorry.
well thats easy too
make a script in workspace and inside the script do this:
local PlayerUserName = "i6Hx" -- Put The Username Here
local PlayerUserId = game.Players:GetUserIdFromNameAsync(PlayerUserName)
if not PlayerUserId then return end
local Image
local success, errormsg = pcall(function()
Image = game.Players:GetUserThumbnailAsync(PlayerUserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
end)
if not success then
warn(errormsg)
return
end
if Image then
game.Workspace.Part.SurfaceGui.ImageLabel.Image = Image
end
Done
Btw Change the Enum.ThumbnailType to whatever u want so like for Ex:
if u want head shot then put Enum.ThumbnailType.HeadShot.
Alright I’m gonna test it thank you for help.
Download his profile picture and put it on the image label
I did it first but I want the image to change when the player changes his avatar
just simply put in workspace
like this:
But! how the script will know my part surface gui
This is the way so he find it change the instances to the names from the path
@fasmandom can this script be used for Guis in starter Gui I can use this for credits and loading screen
I edited some stuff in it to put it in the script children and it works thank you so much for help!!
Well u gotta change it to a local script and make a few changes but it should work
u could tween it as well
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.