Npc's baseparts keep getting deleted?

I was playtesting and suddenly they were getting deleted

Screenshot_61

there is no code that deletes the baseparts.

The scripts don’t get destroyed nor does the Humanoid, can someone please explain this?

1 Like

are they unanchored and falling off the map?

1 Like

no, even if it was it would be colliding with the ground

1 Like

then it is probably a script. Did you check every script?

1 Like

Press Ctrl+Shift+F and look for any code that might be deleting the parts (Look for
:Remove() and :Destory() and see if you find anything)
If it turns up with nothing, put a script in that parts that prints its location every physics frame

function DoPrint()
	print(script.Parent.Position)
end
function Deleted()
	error("Part Deleted")
end
function Parent()
	warn("Look in ".. script.Parent.Parent)
end
game:GetService("RunService").Heartbeat:Connect(DoPrint)
script.Parent.ChildRemoved:Connect(Deleted)
script.Parent.Changed:Connect(Parent)

Edit: Forgot Heartbeat
Edit2: You can also throw an error when the part is deleted
Edit3: Remember to also check that the baseparts are not having their .Parent property changed.

See if what I posted helps

yup, sorry for the inconvenience, turns out you’re right

I got a question, what part of my code ended up telling you the issue?

it kept saying deleted, turns out i used the wrong instances in debri service

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.