Still trys to destroy terrain

I write this script for destroying only parts, but it still trys to destroy the terrain.

local parts = game.Workspace:GetChildren()

for i,v in pairs(parts) do
	  if v:IsA("BasePart") then
		v:Destroy()
	end
end
for i,v in pairs(game.Workspace:GetChildren()) do
	  if v:IsA("BasePart") and v.ClassName ~= "Terrain" then
		v:Destroy()
	end
end
1 Like