What do you want to achieve? Detect if player has a custom face id in them and if they do change it to something else
What is the issue? The script changes for everybody faces even if they don’t have the custom face id
What solutions have you tried so far? tried separating the ids and it didn’t work
game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
for _, child in ipairs(character:GetChildren()) do
if child.Name == "Head" then
local decal = child:FindFirstChildWhichIsA("Decal")
if decal.Texture == "http://www.roblox.com/asset/?id=customfaceid" or "http://www.roblox.com/asset/?id=customfaceid" or "http://www.roblox.com/asset/?id=customfaceid" or "http://www.roblox.com/asset/id?=customfaceid" then
decal.Texture = "rbxthumb://type=Asset&id=" .. DEADFACEID.. "&w=420&h=420"
end
end
end
end)
end)
end)
Script is server, in servescriptservice, side note what i’m trying to do here is make a dead face changer but ONLY change if player has a custom face id.
When checking if then, any value that is not nil or false is considered true, in that line you are asking if decal.Texture is equal to a string, but, as the others are strings, it is considered true, it would read
if true/false or true or true or true or true then
which, eventually, is true.
Change the code to this
local Decal_Ids = {
654,
}
game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
for _, child in ipairs(character:GetChildren()) do
if child.Name == "Head" then
local decal = child:FindFirstChildWhichIsA("Decal")
if decal and table.find(Decal_Ids, tonumber(decal.Texture:match("%d+"))) then
decal.Texture = "rbxthumb://type=Asset&id=" .. DEADFACEID.. "&w=420&h=420"
end
end
end
end)
end)
end)
in Decal_Ids, put the id as a number and separated by a comma.