if you change your skin using player.Skin = skin; your weapon resets. In order to avoid that, add this in your script:
function CPlayer::SetSkin(skin) {
local slot = this.Slot;
this.Skin = skin;
this.Slot = slot;
}
Now use:
player.SetSkin(skinid)
onPlayerSkinChange
If you want this event, use:
function CPlayer::SetSkin(skin) {
local slot = this.Slot, oldskin = this.Skin;
this.Skin = skin;
this.Slot = slot;
onPlayerSkinChange(this, oldskin, skin)
}
Event:
function onPlayerSkinChange(player, OldSkin, NewSkin) {
}
Just a note: no matter what, because of the weapon change, event onPlayerWeaponChange will be called.
(so be aware of that if you have code in that event)
Btw, player.Pos also calls the event. At least, that one puts back the weapon in your hand.