Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i make a part delete ONLY unanchored parts?

I am making a game that i want the ground to delete unanchored parts but i dont want humaniods to die. I made a script that deletes the parts but i deletes all parts humans, anchored parts, and unanchored parts.

1 answer

✓ Accepted answer

This isn't tested and may be a bad way to do it, but i think this may help you

for i,v in pairs(Part:GetTouchingParts()) do
	if v.Anchored == false and not v.Parent:IsA("CharacterMesh") and not v:IsA("CharacterAppearance") then
		v:Destroy()
	end
end

1 comment

0

Change part to your parts, and put this somewhere where it will keep rerunning or whatever you do to make it delete them

This discussion is preserved as it was. New answers, comments, and votes are closed.