Can't set/remove face object!

Hello, I’m having a problem where I can’t set the texture of a players face! checkCustomFaceFunction is working correctly and returns the values!

Code:

local CustomFaceTable_ = {

	{"ItsPlasmaRBLX", "rbxassetid://362505168"};
	{"CoIeRB", "rbxassetid://362505168"};

}

function checkCustomFaceFunction(player)
	for _,v in pairs(CustomFaceTable_) do
		print(v)
		if player.Name == v[1] or player.UserId == v[1] then
			warn("True")
			return true, v[2]
		end
	end
	warn("False")	
	return false, 0
end

sPlayers.PlayerAdded:Connect(function(player)
	local canUseFace, faceTextureID = checkCustomFaceFunction(player)
	if canUseFace then
		warn("Player can use custom face feature! | Continue!")
		player.CharacterAdded:Connect(function(character)
			warn("Character Added.")
			character.Head.face.Texture = faceTextureID
		end)
	end
end)
1 Like

Is this a script or local script, and where is this stored?

This is a script that is stored in ServerScriptService!

I tried this script with my username included and it works. Check and see if it works for you.

local CustomFaceTable = {
	{"ItsPlasmaRBLX", "rbxassetid://362505168"};
	{"CoIeRB", "rbxassetid://362505168"};
}

function checkCustomFaceFunction(player)
	for _, v in pairs(CustomFaceTable) do
		if player.Name == v[1] then
			return true, v[2]
		end
	end
	return false, ""
end

game.Players.PlayerAdded:Connect(function(player)
	local canUseFace, faceTextureID = checkCustomFaceFunction(player)
	if canUseFace then
		print("Player can use custom face feature!")
		player.CharacterAdded:Connect(function(character)
			character.Head.face.Texture = faceTextureID
		end)
	end
end)
local CustomFaces = {
	["ItsPlasmaRBLX"] = "rbxassetid://362505168",
	["CoIeRB"] = "rbxassetid://362505168",
}


game.Players.PlayerAdded:Connect(function(Player)
	local Texture = CustomFaces[Player.Name]
	if Texture then
		Player.CharacterAdded:Connect(function(Character)
			local Head = Character:WaitForChild("Head")
			local Face = Head:WaitForChild("face")
			if Face then
				Face.Texture = Texture
			end
		end)
	end
end)
1 Like

No errors?, maybe you loaded before it made the PlayerAdded or CharacterAdded connection

I honestly have no idea, its working on a dummy startercharacter!

maybe your name is a capital L instead of an i or something… check if your name is spelled correctly

It returns true with the faceTextureID!

I figure it out and I used IDs instead. Go to your friend’s page and copy the numbers on the url.

local CustomFaces = {
	[128620225] = "rbxassetid://362505168",
	-- CoIeRB's id
}

game.Players.PlayerAdded:Connect(function(plr)
	local texture = CustomFaces[plr.UserId]
	
	if texture then
		plr.CharacterAdded:Connect(function(chr)
			local head = chr:WaitForChild("Head")
			local face = head:WaitForChild("face")
			face.Texture = texture
		end)
	end
end)

I’ve tried that method, its still not working for me.

image

Try switching back to usernames.

local CustomFaces = {
	["ItsPlasmaRBLX"] = "rbxassetid://362505168",
	["CoIeRB"] = "rbxassetid://362505168"
}

game.Players.PlayerAdded:Connect(function(plr)
	local texture = CustomFaces[plr.Name]
	if texture then
		plr.CharacterAdded:Connect(function(chr)
			local head = chr:WaitForChild("Head")
			local face = head:WaitForChild("face")
			face.Texture = texture
		end)
	end
end)

Same result, still no changes.

I even tried changing my face and outfit! Same result no success

That’s very odd, I tried running my script and it worked with my username and ID.

I’m honestly not sure what I should do. It works with a dummy StarterCharacter, but not with my Roblox avatar!

Can you send over the place file? I can check what’s up in it.

Placefile_1.rbxl (31.6 KB)

I should mention that I’ve also tried removing/Destroying the face object. However its just not working, I’ve tried skipping heartbeats too, but both of these methods aren’t working! All of the code provided in this thread have also not worked so far. It seems to be working just fine for everyone else, I think this is bug!

It’s working for me right out of the box, I am not sure what’s going on.

Yeah, it’s not the code, this one is on Roblox’s end! It’s even doing it to the avatar page! :shock: