Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Remove a specific face from a roblox player?

Asked by 3 years ago

I am making a game and theres this face which i dislike and is it possible to remove for example

a person with ninja face joins and their face turns into the default smile face when they join

the scripts parent is workspace

local p = game.Players

p.PlayerAdded:Connect(function()
    local char = p.LocalPlayer.Character
    local wa = char.Head:FindFirstChild("face")
    if wa.Texture == 11453609 then
        wa.Texture = nil
    end
end)

if theres something wrong with the code please tell me

i dont own the ninja face so i cant test it and i dont know if any of the answers will be correct

1 answer

Log in to vote
0
Answered by 3 years ago

Check new Decals that may contain the faces you want to blacklist. I would personally use table.find to check a list out of convenience.

workspace.DescendantAdded:Connect(function(FaceInstance: Decal)
    if FaceInstance:IsA("FaceInstance") and table.find({
        [1] = 1234567890,
        [2] = 1234567890,
        [3] = 1234567890, -- List your face blacklist here.
    }, string.match(FaceInstance.Texture, "%d+")) then
        FaceInstance.Texture = "rbxasset://textures\face.png"
    end
end)
Ad

Answer this question