-- Fix grass sticking out of floors local ScanSize = Vector2.new(1100, 1100) local HeightStart = 500 local Direction = Vector3.new(0, -5000, 0) local Origin = Vector3.new(-ScanSize.X/2, HeightStart, -ScanSize.Y/2) local TerrainOnly = RaycastParams.new() local Replace = {} TerrainOnly.FilterDescendantsInstances = {workspace.Terrain} TerrainOnly.FilterType = Enum.RaycastFilterType.Include for y = 1, ScanSize.X, 4 do for x = 1, ScanSize.Y, 4 do local From = Origin+Vector3.new(x, 0, y) local Raycast1 = workspace:Raycast(From, Direction, TerrainOnly) if Raycast1 then if Raycast1.Instance == workspace.Terrain and Raycast1.Material == Enum.Material.Grass then local Raycast2 = workspace:Raycast(From, Direction) if Raycast2 then if not (Raycast2.Instance == workspace.Terrain) then local Position = Raycast1.Position table.insert(Replace, {Region3.new(Vector3.new(-6, -4, -6)+Position, Vector3.new(6, 4, 6)+Position), 4, Enum.Material.Grass, Enum.Material.Mud}) end end end end end end for _, v in ipairs(Replace) do workspace.Terrain:ReplaceMaterial(unpack(v)) end pcall(function() game:GetService("ChangeHistoryService"):SetWaypoint("TerrainGrassFix") end)