This function seems to just skip over the if statement / ignore it and goes right to the elseif, even if the if statement is true...
e.Touched:connect(function(hit)
if hit.Anchored == true and hit.CanCollide == true and hit.Parent ~= char then
if hit.Material == "Grass" then
e.Material = "Slate"
e.BrickColor = BrickColor.new("Brown")
elseif hit.Material ~= "Grass" then
e.Material = hit.Material
e.Color = hit.Color
wait()
end
end
end)

2 comments
which if statement does it skip, it look like the if hit.Anchored... has two spaces between if and hit i dont know if that matters though.
Whitespace is not the error, Lua ignores this.