I am working on a FPS game and i am trying to make a screenGui that will display a players health and a picture of their avatar.
I havent tested any code because i am completely lost on this. Any help would be greatly appreciated. Thank you.
I am working on a FPS game and i am trying to make a screenGui that will display a players health and a picture of their avatar.
I havent tested any code because i am completely lost on this. Any help would be greatly appreciated. Thank you.
Not a script request site. But will give it to ya anyways.
local label = script.Parent.TextLabel -- your text label you want to show the name in
local image = script.Parent.ImageLabel -- your image label you want to show the picture in
local Players = game:GetService("Players") --the players service
--fetch the thumbnail
local userId = game.Players.LocalPlayer.UserId
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
label.Text = game.Players.LocalPlayer.Name -- changes the text label's text to the player's name
image.Image = content --changes the imagelabel's image to be the headshot image
Put inside a LocalScript inside a ScreenGui with a TextLabel and a ImageLabel. ~Dan_PanMan, experienced scripter.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thanks Dan_PacMan!