Is there a way to get the headshot Image of an NPC?

I’m wondering if it’s possible to get a headshot image of an NPC because I’m making a story game and I want my dialogue show the NPC talk.

This is the main script for the game which is in ServerScriptService:

local status = game.ReplicatedStorage:WaitForChild("Status")
local dialogueEv = game.ReplicatedStorage.RemoteEvents.GuiEvents.Dialogue
local toggleDialogue = game.ReplicatedStorage.RemoteEvents.ToggleEvents.ToggleDialogue

local Npc = game.Workspace.NPC.Mike
local NpcImg = "rbxassetid://2128423326"
local NpcName = Npc.Name

local NpcFace = Npc.Head.face

local imgFrameType = {Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420}

local playerName
local playerImg

local function randomPlayer()
	local players = game.Players:GetPlayers()
	local playerNumber = math.random(1, #players)

	local chosen = players[playerNumber]

	playerImg = game.Players:GetUserThumbnailAsync(chosen.UserId, imgFrameType)
	playerName = chosen.Name
end



wait(3)
dialogueEv:FireAllClients(NpcImg, NpcName, "This is a test dialogue.")

However, the image is basically blank. Is there any way to get the NPC image for this?

Instead of using an image, you could use a ViewportFrame and a clone of the NPC. You would then have to position and orient the camera in a manner that it is facing the NPC to your desire.

3 Likes

I had a similar query, although for me I just dressed my in-game Roblox avatar to the NPC, saved the image to Roblox, then used that image as the NPC portrait.

Obviously that won’t work for everyone as some clothing and accessories on NPC’s aren’t in the Roblox catalogue or you just don’t want to buy it

4 Likes

LOL that’s really funny and clever! I like this solution more than mine.

3 Likes