Hey Developers!
I’m having a bit of a problem, I’m scripting an NPC system and when the NPC touches this part I want it to disappear into ServerStorage, as far as I’m aware it’s moving the NPC to ServerStorage but it’s still showing some of the body. Most of it disappears but you can occasionally see the odd arm or leg, I’ve tried things suggested to me like for loops and other things but it’s still not working.
Any help would be appreciated. 
Part Code
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == workspace.NPCValues.NPCActiveName.Value then
hit.Parent = game.ServerStorage.NPC
end
end)

Is this like a tower defense simulator type game? or just a npc being moved to a part?
Why don’t you just store the npc’s in ServerStorage and clone them when you spawn them in and delete them on touch?
I tried deleting on touch, some of the body still shows.
You’re parenting the touched part, instead, parent the entire model at once and it should work
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == workspace.NPCValues.NPCActiveName.Value then
hit.Parent.Parent = game.ServerStorage.NPC
end
end)
This did nothing, it didn’t move it. I did some trial and error where I tried this code and my original code and my original code moved some of it where doing hit.parent.parent
did nothing.
Is hit.Parent
equal to the whole NPC model, or are you sure that every body part is parented into the NPC model?
Every part is inside the model that is hitting the part, yes.