Make Weapon Change Player Model

Hey Guys,

On my ttt server, im trying to make it where if a detective buys this specific weapon it changes his player model. I saw a command (ply:SetModel) but im not sure how i could implement this into a weapon.

Any help is appreciated.

Thank You.

I’m begginer on lua, you can do that on init.lua:



hook.Add( "PlayerCanPickupWeapon", "ChangeMyModel", function( ply, ent )

  if ent.GetClass() == "weapon's name here!!!!" then
    ply:SetModel( "models/player/odessa.mdl" )
  end

end )


I would not recommend the above. Instead, do it all through the SWEP:Deploy() and SWEP:Holster() functions. Save the player’s original player model on deploy as a variable on the swep then change it to whatever you want with SetModel. On holster, change it back to their original model.

Thanks for the help guys. Really Helped.