Face not appearing when changing Texture

  1. What do you want to achieve?

I want to change the face texture of the player

  1. What is the issue?

When I change the Texture of the decal, the face becomes blank like in the image below

image

  1. What solutions have you tried so far?

I tried using print statements to debug the script and I also made sure that the decal ID changed.

Here is the WHOLE code

local removeHats = game.ReplicatedStorage:WaitForChild("RemoveHats")
local equipEvent = game.ReplicatedStorage:WaitForChild("EquipItem")
local IS = game:GetService("InsertService")

removeHats.OnServerEvent:Connect(function(plr)
	local char = plr.Character or plr.CharacterAdded:Wait()
	for i,v in pairs(char:GetChildren()) do
		if v:IsA("Accessory") then
			v:Destroy()
		end
	end
end)

equipEvent.OnServerEvent:Connect(function(plr,itemName,itemId,itemType)
	local char = plr.Character or plr.CharacterAdded:Wait()
	
	if itemType == "Hair" then
		for i,v in pairs(char:GetChildren()) do
			if v:IsA("Accessory") then
				local ivVal = v:FindFirstChild("ItemType")
				if ivVal then
					if ivVal.Value == "Hair" then
						v:Destroy()
					end
				end
			end
		end
		
		local hair = IS:LoadAsset(itemId)
		local hairA = hair:FindFirstChildOfClass("Accessory")
		local iv = Instance.new("StringValue",hairA)
		iv.Name = "ItemType"
		iv.Value = itemType
		hairA.Parent = char
		hair:Destroy()
	elseif itemType == "Hats" then
		local hat = IS:LoadAsset(itemId)
		local hatA = hat:FindFirstChildOfClass("Accessory")
		local iv = Instance.new("StringValue",hatA)
		iv.Name = "ItemType"
		iv.Value = itemType
		hatA.Parent = char
		hat:Destroy()
	elseif itemType == "Face" then
		local face = char.Head:WaitForChild("face")
		face.Texture = "http://www.roblox.com/asset/?id="..itemId
	end
end)

This is where I change the Texture

elseif itemType == "Face" then
		local face = char.Head:WaitForChild("face")
		face.Texture = "http://www.roblox.com/asset/?id="..itemId
	end
end)

Thanks in Advance.

you can check the output for the image if it loads, or try changing ID to
rbxassetid://

1 Like

I tried using rbxassetid and still the face appears blank and there are no errors

maybe it’s the first issue and you need to reupload image(check if image loads on any other parts)

I tried manually changing the ID from the explorer and it did work

The image might not be accepted onto roblox, what image are you trying to put in? I don’t think that a script will fix this error.

1 Like

The image that I am using is a Roblox uploaded face. Here is the ID: 42070576

The problem is that’s a face ID not an image ID. You will need to use rbxassetid://42070872 in your case. You can use InsertService to get the image ID of a face id in the future btw or you could use a humanoid description, change it’s Face property, and apply it to the npc.

Ok i just made a decal try this and see if it works: face help - Roblox copy and paste it.

I tried it myself and it just worked for me with the id that I sent you.

A huge thank you to all that tried to help me.Vulkarin’s solution worked perfectly for me.

1 Like