set view model texture

Does anybody know how to set the view models texture, using lua?

pl:GetViewModel( ):SetMaterial( mat )

I think.

Doesn’t seem to work for me.

Should, did you get an error?