Why doesn't this work? It's supposed to make it so it only prints on grass, but it doesn't print at all?
local Ignorelist = {} local descendants = workspace:GetDescendants() for index, descen in pairs(descendants) do if not Ignorelist[descen.Name] then if descen.ClassName == "Part" or descen.ClassName == "MeshPart" or descen.ClassName == "Union" then if descen.Material == "Grass" then table.insert(Ignorelist, descen.Name) end end end end local ray = Ray.new(HumanoidRootPart.Position,Vector3.new(0,-10,0)) local part, endPoint, Normal, Material = workspace:FindPartOnRayWithIgnoreList(ray, Ignorelist) if part then print(part.Name) end
Instead of putting it into a table, put a folder in workspace called ignore and add all parts you want to be ignored in there. Then take the descendants of that table and use it as the ignorelist.