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)
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)
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)
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)
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!