local CharacterName = "Xapelize"
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
wait(0.5)
if character.Name == CharacterName then
for _, DetectingPart in pairs(game.Workspace:WaitForChild("Xapelize"):GetChildren()) do
if DetectingPart:IsA("Accessory") then
DetectingPart.Parent = game:GetService("ServerStorage")
print(DetectingPart.Name .." is an accessory")
elseif DetectingPart:IsA("MeshPart") or DetectingPart:IsA("Part") then
DetectingPart.Transparency = 1
print(DetectingPart.Name .." is a mesh part")
else
print(DetectingPart.Name .." is neither accessory nor mesh part, it's a ".. DetectingPart.ClassName)
end
if DetectingPart:IsA("Part") and DetectingPart.Name == "Head" then
for _, DetectingChildrenHead in pairs(DetectingPart:GetChildren()) do
if DetectingChildrenHead:IsA("Decal") then
DetectingChildrenHead.Transparency = 1
end
end
end
end
print("Character".. CharacterName .." is invisible")
else
print(player.Name .." is not ".. CharacterName)
end
end)
end)
3 comments
If you are using r15 characters then this will likely not work.
Please directly index the bodyparts since you are not detecting if it is there, also most probability the character did not load or the character is R15, use player.CharacterAppearanceLoaded
Consider replacing all the findFirstChild to WaitForChild