Heres the script, it's responding to print the part's name but couldn't find the part's material.
for i,v in pairs(game.Workspace:GetChildren()) do if v.Name == "P1" and v:IsA("WedgePart") then print(v.Name) if v.Material == "Grass" then -- Not working here v.BrickColor = BrickColor.new("Medium green") end end end
use this:
if v.Material == Enum.Material.Grass then