Garry's Mod Wiki

Revision Difference

GM:PlayerSetHandsModel#553114

<function name="PlayerSetHandsModel" parent="GM" type="hook"> <ishook>yes</ishook>⤶ <description>Called whenever view model hands needs setting a model. By default this calls <page>PLAYER:GetHandsModel</page> and if that fails, sets the hands model according to his player model.</description> <realm>Server</realm> <predicted>No</predicted>⤶ <args> <arg name="ply" type="Player">The player whose hands needs a model set</arg> <arg name="ent" type="Entity">The hands to set model of</arg> </args> </function> <example> <description>Sets the players hands to the model's hands.</description> <code> function GM:PlayerSetHandsModel( ply, ent ) local simplemodel = player_manager.TranslateToPlayerModelName(ply:GetModel()) local info = player_manager.TranslatePlayerHands(simplemodel) if info then ent:SetModel(info.model) ent:SetSkin(info.skin) ent:SetBodyGroups(info.body) end end </code> </example>