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

1local p = game.Players
2 
3p.PlayerAdded:Connect(function()
4    local char = p.LocalPlayer.Character
5    local wa = char.Head:FindFirstChild("face")
6    if wa.Texture == 11453609 then
7        wa.Texture = nil
8    end
9end)

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.

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

Answer this question