local function b(b,Q,O)O=O or 0 local o=b.Size+Vector3.new(O*2,0,O*2)for O=1,o.X/3,1 do for w=1,o.Z/3,1 do if(w+O)%200==0 then wait()end local K=CFrame.new(b.CFrame:PointToWorldSpace(Vector3.new(O*3,Q,w*3)-Vector3.new(o.X/2,0,o.Z/2)))local I=Vector3.new(5,5,5)local J=Region3.new(K:PointToWorldSpace(-Vector3.new(I.X/2,5,I.Z/2)),K:PointToWorldSpace(Vector3.new(I.X/2,5,I.Z/2)))workspace.Terrain:ReplaceMaterial(J:ExpandToGrid(4),4,Enum.Material.Grass,Enum.Material.LeafyGrass)end end end local function Q(Q,O)b(Q,0,O)end local function O(b)for O,o in pairs(workspace:GetDescendants())do if o:IsA("\066\097\115\101\080\097\114\116")and(not o:IsA("\077\101\115\104\080\097\114\116")and(not o:IsA("\084\101\114\114\097\105\110")and o.Size.Y<10))then print(o)if O%100==0 then wait()end Q(o,b)end end print("\070\073\078\073\083\072\069\068")end wait()O(2)
--Copy the following code from line #3-39 and paste it in the command bar. Then press enter.

local function regionPaintPart(p, yC, padding)
	--[[each part is divided into smaller regions (each with a size of 4x4 studs) since some parts are rotated and regions cant be rotated]]
	padding = padding or 0
	local s = p.Size + Vector3.new(padding * 2, 0, padding * 2)
	for x = 1, s.X / 3 do
		for z = 1, s.Z / 3 do
			if ((z + x) % 200) == 0 then
				wait()
			end
			local p2c =
				CFrame.new(p.CFrame:PointToWorldSpace(Vector3.new(x * 3, yC, z * 3) - Vector3.new(s.X / 2, 0, s.Z / 2)))
			local p2s = Vector3.new(5, 5, 5)
			local r = Region3.new(
				p2c:PointToWorldSpace(-Vector3.new(p2s.X / 2, 5, p2s.Z / 2)),
				p2c:PointToWorldSpace(Vector3.new(p2s.X / 2, 5, p2s.Z / 2))
			)
			workspace.Terrain:ReplaceMaterial(r:ExpandToGrid(4), 4, Enum.Material.Grass, Enum.Material.LeafyGrass)
		end
	end
end

local function FixGrassPart(p, pad)
	regionPaintPart(p, 0, pad)
end

local function FixAllGrassParts(pad)
	for _, v in pairs(workspace:GetDescendants()) do
		if v:IsA("BasePart") and not v:IsA("MeshPart") and not v:IsA("Terrain") and v.Size.Y < 10 then
			print(v)
			if (_ % 100) == 0 then
				wait() --[[Waits every 100 parts so it doesn't freeze studio]]
			end
			FixGrassPart(v, pad)
		end
	end
	print("FINISHED")
end

wait()

FixAllGrassParts(2)
