I have a morth script and the idea is that it sticks different parts on your body and makes the morth, but your body turn invisible. It worked perfectly fine but it stopped working for some reason and I am getting an error in this script:
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid")
if human ~= nil then
part.Parent:findFirstChild("Head").Transparency = 1
part.Parent:findFirstChild("Torso").Transparency = 1
part.Parent:findFirstChild("Left Arm").Transparency = 1
part.Parent:findFirstChild("Right Arm").Transparency = 1
part.Parent:findFirstChild("Left Leg").Transparency = 1
part.Parent:findFirstChild("Right Leg").Transparency = 1
if part.Parent:findFirstChild("Head"):findFirstChild("face") == nil then return end
part.Parent:findFirstChild("Head"):findFirstChild("face"):remove()
if part.Parent:findFirstChild("Torso"):findFirstChild("roblox") == nil then return end
part.Parent:findFirstChild("Torso"):findFirstChild("roblox"):remove()
end
end
script.Parent.Touched:connect(onTouch)
THE ERROR: "Workspace.Morph maker.Floating Head.Script:7: attempt to index a nil value"
Could anyone help me? As I said it DID work. For some reason it stopped.

5 comments
Explain why this code works and how this code works so that he and others like him wouldn't make the same mistake in the future. You could also explain why you've tabbed your code how you did now so that he could do the same in the future. We're teaching people how to code, not doing work for them.
basically this gets the player by checking if 'hit.Parent.Name' is in Players. Next, I used a loop (for i, v in pairs) to get objects in the player's character. After that, it filters if the object is a part or not . Lastly, the script sets the part(s) transparency to 1 (so its not visible) and clears any children in the part (faces, decals, t shirts.. yea)
oh yes very important part! last line links the Touched event to the part. dont forget that!111
Thank you. :) I have some big plans, hope this will help me in the future. Right now its all good.
No problem, good luck!