Garry's Mod Wiki

Revision Difference

Entity:SetSubMaterial#518274

<function name="SetSubMaterial" parent="Entity" type="classfunc"> <description> Overrides a single material on the model of this entity. To set a Lua material created with <page>Global.CreateMaterial</page>, just prepend a "!" to the material name. <bug issue="3362">The server's value takes priority on the client.</bug> </description> <realm>Shared</realm> <args> <arg name="index" type="number" default="nil">Index of the material to override, acceptable values are from 0 to 31.&#xA;&#xA;Indexes are by &lt;page&gt;Entity:GetMaterials&lt;/page&gt;, but you have to subtract 1 from them.&#xA;&#xA;If called with no arguments, all sub materials will be reset.</arg>⤶ <arg name="index" type="number" default="nil">Index of the material to override, acceptable values are from 0 to 31.⤶ Indexes are by <page>Entity:GetMaterials</page>, but you have to subtract 1 from them.⤶ ⤶ If called with no arguments, all sub materials will be reset.</arg>⤶ <arg name="material" type="string" default="nil">The material to override the default one with. Set to nil to revert to default material.</arg> </args> </function>