Removing the weapon model while leaving the hands?

I’ve made a flaming torch by mashing up some Toybox ents, but I don’t know how to rid myself of the crowbar in first person while leaving the grippy fists in tact.
Anyone know how to?
Thanks.
Picture:

Relevent Code:
[lua]SWEP.NextVMFire = 0;
local VMOffset = Vector(-1.5,3,5);
local VMFireOffset = Vector(1,-5,15);
local function calcOffset(ang, off)
return ang:Right() * off.x + ang:Forward() * off.y + ang:Up() * off.z;
end
function SWEP:ViewModelDrawn()
local owner = self.Owner;
if (not (IsValid(owner) and IsValid(self.VM))) then
return;
end
local vm = owner:GetViewModel();
local matrix = vm:GetBoneMatrix(vm:LookupBone(“ValveBiped.Bip01_R_Hand”));
local ang = matrix:GetAngle();
ang:RotateAroundAxis(ang:Forward(),180);
local pos = matrix:GetTranslation();
self.VM:SetRenderOrigin(pos + calcOffset(ang, VMOffset));
self.VM:SetRenderAngles(ang);
self.VM:DrawModel();
local firepos = pos + calcOffset(ang, VMFireOffset);
self:DoLight(firepos);
local time = CurTime();
if (time < self.NextVMFire) then
return;
end
self.NextFire = time + 0.024;
self:Particle(firepos, true);
end[/lua]
Entire code:


--[[
    ~ Flaming Torch ~ 
    ~ Lexi ~
--]]

if (SERVER) then
    AddCSLuaFile("shared.lua");
else
    SWEP.PrintName = "Flaming Torch";
    SWEP.Slot = 2;
    SWEP.SlotPos = 1;
    SWEP.DrawAmmo = true;
    SWEP.IconLetter = "c"
    SWEP.DrawCrosshair = false;
    function SWEP:DrawWeaponSelection(x, y, wide, tall, alpha)
        draw.SimpleText(self.IconLetter, "TitleFont2", x + 0.5*wide, y --[[+ tall*0.2]], Color(255, 220, 0, 255), TEXT_ALIGN_CENTER )
        self:PrintWeaponInfo(x + wide + 20, y + tall*0.95, alpha)
    end
end

--[[ Vars ]]--
    SWEP.Author    = "Lexi";
    SWEP.Purpose = "Trying to see in the dark";

    SWEP.ViewModel = "models/weapons/v_crowbar.mdl";
    SWEP.WorldModel = "models/weapons/w_crowbar.mdl";
    SWEP.AnimPrefix    = "crowbar";
    SWEP.Spawnable = true;
    SWEP.AdminSpawnable = true;
    SWEP.ViewModelFOV = 70
      
    SWEP.Primary.ClipSize = 1
    SWEP.Primary.DefaultClip = 1
    SWEP.Primary.Automatic = false
    SWEP.Primary.Ammo = "GaussEnergy"

    SWEP.Secondary.ClipSize = -1
    SWEP.Secondary.DefaultClip = 0
    SWEP.Secondary.Automatic = false
    SWEP.Secondary.Ammo = ""
    
-- Called when the SWEP is initialized.
function SWEP:Initialize()
    self:SetWeaponHoldType("melee");
    if (CLIENT) then
        self:CreateAttachments();
        self.Emitter = ParticleEmitter(Vector(0,0,0));
    end
end
function SWEP:PrimaryAttack()

end
function SWEP:SecondaryAttack()

end

--[[ Clientside only from now on ]]--
if (SERVER) then
    return;
end

--[[ Torch Attachment ]]--
--[[
    -- First Author: Jvs
    -- URL: http://toybox.garrysmod.com/ingame/?view=2328&tab=code
    -- Notes:
        Cleaned up quite a bit
--]]
SWEP.VM = nil;
SWEP.WM = nil;
SWEP.HM = nil;
local model = "models/Gibs/furniture_gibs/FurnitureDrawer002a_gib05.mdl"
local scale = Vector(1,1,1.2)
local function fightMeCoward()
    local mdl = ClientsideModel(model, RENDER_GROUP_OPAQUE_ENTITY);
    mdl:SetNoDraw(true);
    mdl:SetModelScale(scale);
    return mdl;
end
function SWEP:CreateAttachments()
    if (not IsValid(self.VM)) then
        self.VM = fightMeCoward();
    end if (not IsValid(self.WM)) then
        self.WM = fightMeCoward();
    end 
end


SWEP.NextVMFire = 0;
local VMOffset = Vector(-1.5,3,5);
local VMFireOffset = Vector(1,-5,15);
local function calcOffset(ang, off)
    return ang:Right() * off.x + ang:Forward() * off.y + ang:Up() * off.z;
end
function SWEP:ViewModelDrawn()
    local owner = self.Owner;
    if (not (IsValid(owner) and IsValid(self.VM))) then
        return;
    end
    local vm = owner:GetViewModel();
    local matrix = vm:GetBoneMatrix(vm:LookupBone("ValveBiped.Bip01_R_Hand"));
    local ang = matrix:GetAngle();
    ang:RotateAroundAxis(ang:Forward(),180);
    local pos = matrix:GetTranslation();
    self.VM:SetRenderOrigin(pos + calcOffset(ang, VMOffset));
    self.VM:SetRenderAngles(ang);
    self.VM:DrawModel();
    local firepos = pos + calcOffset(ang, VMFireOffset);
    self:DoLight(firepos);
    local time = CurTime();
    if (time < self.NextVMFire) then
        return;
    end
    self.NextFire = time + 0.024;
    self:Particle(firepos, true);
end

local WMUpOffset = 15;
local WMFireUpOffset = 30

SWEP.HoldAng = Angle(0,0,0);
SWEP.NextWMFire = 0
function SWEP:DrawWorldModel()
    if (not IsValid(self.WM)) then
        return;
    end
    --[[
        -- First Author: Andrew McWatters
        -- URL: http://swep-bases.googlecode.com/
        -- Notes:
            I had to clean this up a bit too.
    -]]
    local owner = self.Owner;
    if (not IsValid(owner)) then
        return;
    end
    if ( not self.WMHans ) then
        self.WMHans = owner:LookupAttachment("anim_attachment_RH");
    end

    local hand = owner:GetAttachment(self.WMHans);
    if (not hand) then
        return;
    end
    local up = hand.Ang:Up();
    local offset = up * WMUpOffset
    --[[
    local offset =    -- hand.Ang:Right() * self.HoldPos.x +
                    -- hand.Ang:Forward() * self.HoldPos.y +
                       hand.Ang:Up() * self.HoldPos.z;

--    hand.Ang:RotateAroundAxis( hand.Ang:Right(),    self.HoldAng.x );
--    hand.Ang:RotateAroundAxis( hand.Ang:Forward(),    self.HoldAng.y );
--    hand.Ang:RotateAroundAxis( hand.Ang:Up(),        self.HoldAng.z );
--]]
    self.WM:SetRenderOrigin( hand.Pos + offset );
    self.WM:SetRenderAngles( hand.Ang );
    self.WM:DrawModel();
    self.HM:DrawModel();
    local firepos = hand.Pos + up * WMFireUpOffset;
    self:DoLight(firepos)
    local time = CurTime()
    if (time < self.NextWMFire) then
        return;
    end
    self.NextFire = time + 0.024;
    self:Particle(firepos);
end

--[[ Fire ]]--
--[[
    -- First Author: Microosoft
    -- Second Author: Robotboy655â„¢
    -- URL: http://toybox.garrysmod.com/ingame/?view=242&tab=code
--]]
function SWEP:Particle(pos, vm)
    if (not self.Emitter) then
        return;
    end
    local particle = self.Emitter:Add("effects/fire_cloud1",pos);
    if (not particle) then
        return;
    end
    particle:SetDieTime(1);
    particle:SetStartAlpha(128);
    particle:SetEndAlpha(0);
    if (vm) then
        particle:SetStartSize(7);
        particle:SetEndSize(0);
    else
        particle:SetStartSize(10);
        particle:SetEndSize(2);
    end
    particle:SetRoll(8);
    particle:SetRollDelta(math.Rand(-8,8));
    particle:SetAirResistance(256);
    particle:SetGravity(Vector(0,0,256));
end

--[[ Lighting ]]--
function SWEP:DoLight(pos)
    local dlight = DynamicLight( self:EntIndex() )
    if (not dlight ) then return; end
    dlight.Pos = pos
    dlight.r = 255
    dlight.g = 147
    dlight.b = 23
    dlight.Brightness = 5.9
    dlight.Decay = 420 * 5
    dlight.Size = 420
    dlight.DieTime = CurTime() + 1
end

Take a look at my saw-bow code (I’d link you but toybox won’t open:emo:)

Afaik removing/coloring/changing the texture of attachments or bones is not possible with gmod lua but I’m not sure.

I believe you could make a clip plane for the viewmodel, but I’m sure there’s a better way.

Unfortunately the crowbar doesn’t seem to have a convenient bone to be shrunk. The closest I could find was valvebiped.tip, which apparently doesn’t have a bonematrix.

You could make the real viemodel invisible and bonemerge a clientside model to it which uses the empty hands viewmodel.

Not perfect, but not bad. Thanks a lot for your help Ralle.


--[[
    ~ Flaming Torch ~ 
    ~ Lexi ~
--]]

if (SERVER) then
    AddCSLuaFile("shared.lua");
else
    SWEP.PrintName = "Flaming Torch";
    SWEP.Slot = 2;
    SWEP.SlotPos = 1;
    SWEP.DrawAmmo = true;
    SWEP.IconLetter = "/"
    SWEP.DrawCrosshair = false;
    function SWEP:DrawWeaponSelection(x, y, wide, tall, alpha)
        draw.SimpleText(self.IconLetter, "TitleFont2", x + 0.5*wide, y + tall*0.2, Color(255, 220, 0, 255), TEXT_ALIGN_CENTER );
        self:PrintWeaponInfo(x + wide + 20, y + tall*0.95, alpha);
    end
end

--[[ Vars ]]--
    SWEP.Author    = "Lexi";
    SWEP.Purpose = "Trying to see in the dark";

    SWEP.ViewModel = "models/weapons/v_crowbar.mdl";
    SWEP.WorldModel = "models/weapons/w_crowbar.mdl";
    SWEP.AnimPrefix    = "crowbar";
    SWEP.Spawnable = true;
    SWEP.AdminSpawnable = true;
    SWEP.ViewModelFOV = 70;
      
    SWEP.Primary.ClipSize = 1;
    SWEP.Primary.DefaultClip = 1;
    SWEP.Primary.Automatic = false;
    SWEP.Primary.Ammo = "GaussEnergy";

    SWEP.Secondary.ClipSize = -1;
    SWEP.Secondary.DefaultClip = 0;
    SWEP.Secondary.Automatic = false;
    SWEP.Secondary.Ammo = "";
    
-- Called when the SWEP is initialized.
function SWEP:Initialize()
    self:SetWeaponHoldType("melee");
    if (CLIENT) then
        self:CreateAttachments();
        self.Emitter = ParticleEmitter(Vector(0,0,0));
    end
end
function SWEP:PrimaryAttack()

end
function SWEP:SecondaryAttack()

end

--[[ Clientside only from now on ]]--
if (SERVER) then
    return;
end

--[[ Model Attachment ]]--
--[[
    -- First Author: Jvs
    -- URL: http://toybox.garrysmod.com/ingame/?view=2328&tab=code
    -- Notes:
        Cleaned up quite a bit
--]]
SWEP.VM = nil;
SWEP.WM = nil;
SWEP.HM = nil;
local model = "models/Gibs/furniture_gibs/FurnitureDrawer002a_gib05.mdl"
local scale = Vector(1,1,1.2)
local function fightMeCoward()
    local mdl = ClientsideModel(model, RENDER_GROUP_OPAQUE_ENTITY);
    mdl:SetNoDraw(true);
    mdl:SetModelScale(scale);
    return mdl;
end
--[[
    -- Given by: Grea$eMonkey
    -- Notes:
    --    <33
--]]
local scalevec = Vector(0.01,0.01,0.01);
local function bbones(self)
    if (self.oldBbones) then
        self:oldBbones();
    end
    local b = self:LookupBone("valvebiped.bip01_l_upperarm");
    if (not b) then
        return;
    end
    local m = self:GetBoneMatrix(b);
    if (not m) then
        return;
    end
    m:Scale(scalevec);
    self:SetBoneMatrix(b,m);
end
function SWEP:CreateAttachments()
    if (not IsValid(self.VM)) then
        self.VM = fightMeCoward();
    end if (not IsValid(self.WM)) then
        self.WM = fightMeCoward();
    end if (not IsValid(self.HM)) then
        if (not self.Owner:IsValid()) then
            return;
        end
        local hm = fightMeCoward();
        hm:SetModel("models/weapons/v_hands.mdl");
        local vm = self.Owner:GetViewModel();
        if (not IsValid(vm)) then
            return;
        end
        hm:AddEffects( EF_BONEMERGE | EF_BONEMERGE_FASTCULL | EF_PARENT_ANIMATES );
        hm:SetParent(vm);
        -- Hook the bones to get rid of the unwanted bits from the hands
        hm.oldBbones = hm.BuildBonePositions;
        hm.BuildBonePositions = bbones;
        self.HM = hm;
    end
end

function SWEP:Think()
    self:CreateAttachments();
    if (self.Holstered) then
        self:Deploy()
    end
end

function SWEP:Deploy()
    self.Holstered = false;
    if (not IsValid(self.Owner)) then
        return;
    end
    local vm = self.Owner:GetViewModel();
    if (not IsValid(vm)) then
        return;
    end
    vm:SetColor(255,255,255,1);
end

function SWEP:Holster()
    self.Holstered = true;
    if (not IsValid(self.Owner)) then
        return;
    end
    local vm = self.Owner:GetViewModel();
    if (not IsValid(vm)) then
        return;
    end
    vm:SetColor(255,255,255,255);
    self.HM = nil;
end
    

SWEP.NextVMFire = 0;
local VMOffset = Vector(-1.5,3,12);
local VMFireOffset = Vector(0,-7,20);
local function calcOffset(ang, off)
    return ang:Right() * off.x + ang:Forward() * off.y + ang:Up() * off.z;
end
function SWEP:ViewModelDrawn()
    local owner = self.Owner;
    if (not (IsValid(owner) and IsValid(self.VM))) then
        return;
    end
    local vm = owner:GetViewModel();
    local matrix = vm:GetBoneMatrix(vm:LookupBone("ValveBiped.Bip01_R_Hand"));
    local ang = matrix:GetAngle();
    ang:RotateAroundAxis(ang:Forward(),180);
    local pos = matrix:GetTranslation();
    self.VM:SetRenderOrigin(pos + calcOffset(ang, VMOffset));
    self.VM:SetRenderAngles(ang);
    render.SetBlend(1) -- Thanks Ram :D
    self.VM:DrawModel();
    if (IsValid(self.HM)) then
        self.HM:DrawModel();
    end
    local firepos = pos + calcOffset(ang, VMFireOffset);
    self:DoLight(firepos);
    local time = CurTime();
    if (time < self.NextVMFire) then
        return;
    end
    self.NextFire = time + 0.024;
    self:Particle(firepos, true);
end

local WMUpOffset = 15;
local WMFireUpOffset = 30

SWEP.HoldAng = Angle(0,0,0);
SWEP.NextWMFire = 0
function SWEP:DrawWorldModel()
    if (not IsValid(self.WM)) then
        return;
    end
    --[[
        -- First Author: Andrew McWatters
        -- URL: http://swep-bases.googlecode.com/
        -- Notes:
            I had to clean this up a bit too.
    -]]
    local owner = self.Owner;
    if (not IsValid(owner)) then
        return;
    end
    if ( not self.WMHans ) then
        self.WMHans = owner:LookupAttachment("anim_attachment_RH");
    end

    local hand = owner:GetAttachment(self.WMHans);
    if (not hand) then
        return;
    end
    local up = hand.Ang:Up();
    local offset = up * WMUpOffset
    --[[
    local offset =    -- hand.Ang:Right() * self.HoldPos.x +
                    -- hand.Ang:Forward() * self.HoldPos.y +
                       hand.Ang:Up() * self.HoldPos.z;

--    hand.Ang:RotateAroundAxis( hand.Ang:Right(),    self.HoldAng.x );
--    hand.Ang:RotateAroundAxis( hand.Ang:Forward(),    self.HoldAng.y );
--    hand.Ang:RotateAroundAxis( hand.Ang:Up(),        self.HoldAng.z );
--]]
    self.WM:SetRenderOrigin( hand.Pos + offset );
    self.WM:SetRenderAngles( hand.Ang );
    self.WM:DrawModel();
    local firepos = hand.Pos + up * WMFireUpOffset;
    self:DoLight(firepos)
    local time = CurTime()
    if (time < self.NextWMFire) then
        return;
    end
    self.NextFire = time + 0.024;
    self:Particle(firepos);
end

--[[ Fire ]]--
--[[
    -- First Author: Microosoft
    -- Second Author: Robotboy655™
    -- URL: http://toybox.garrysmod.com/ingame/?view=242&tab=code
--]]
function SWEP:Particle(pos, vm)
    if (not self.Emitter) then
        return;
    end
    local particle = self.Emitter:Add("effects/fire_cloud1",pos);
    if (not particle) then
        return;
    end
    particle:SetDieTime(1);
    particle:SetStartAlpha(128);
    particle:SetEndAlpha(0);
    if (vm) then
        particle:SetStartSize(7);
        particle:SetEndSize(0);
    else
        particle:SetStartSize(10);
        particle:SetEndSize(2);
    end
    particle:SetRoll(8);
    particle:SetRollDelta(math.Rand(-8,8));
    particle:SetAirResistance(256);
    particle:SetGravity(Vector(0,0,256));
end

--[[ Lighting ]]--
function SWEP:DoLight(pos)
    local dlight = DynamicLight( self:EntIndex() )
    if (not dlight ) then return; end
    dlight.Pos = pos
    dlight.r = 255
    dlight.g = 147
    dlight.b = 23
    dlight.Brightness = 5.9
    dlight.Decay = 420 * 5
    dlight.Size = 420
    dlight.DieTime = CurTime() + 1
end

What about http://wiki.garrysmod.com/?title=Player.DrawViewModel instead of editing the weapons colour alpha. :raise:

Would not that stop ViewModelDrawn from being called,thus defeating the weapon concept itself?

[editline]25th October 2010[/editline]
Yay for post merging!
[img_thumb]http://i227.photobucket.com/albums/dd126/Jvsthebest/gm_construct0001.jpg?t=1288029594[/img_thumb]
Is it good enough for you?



--[[
    ~ Flaming Torch ~ 
    ~ Lexi ~
--]]

if (SERVER) then
    AddCSLuaFile("shared.lua");
else
    SWEP.PrintName = "Flaming Torch";
    SWEP.Slot = 2;
    SWEP.SlotPos = 1;
    SWEP.DrawAmmo = true;
    SWEP.IconLetter = "c"
    SWEP.DrawCrosshair = false;
    function SWEP:DrawWeaponSelection(x, y, wide, tall, alpha)
        draw.SimpleText(self.IconLetter, "TitleFont2", x + 0.5*wide, y --[[+ tall*0.2]], Color(255, 220, 0, 255), TEXT_ALIGN_CENTER )
        self:PrintWeaponInfo(x + wide + 20, y + tall*0.95, alpha)
    end
end

--[[ Vars ]]--
    SWEP.Author    = "Lexi";
    SWEP.Purpose = "Trying to see in the dark";
	SWEP.ViewModel			= "models/weapons/v_animhands.mdl"
    SWEP.WorldModel = "models/weapons/w_crowbar.mdl";
    SWEP.AnimPrefix    = "crowbar";
    SWEP.Spawnable = true;
    SWEP.AdminSpawnable = true;
    SWEP.ViewModelFOV = 54
      
    SWEP.Primary.ClipSize = 1
    SWEP.Primary.DefaultClip = 1
    SWEP.Primary.Automatic = false
    SWEP.Primary.Ammo = "GaussEnergy"

    SWEP.Secondary.ClipSize = -1
    SWEP.Secondary.DefaultClip = 0
    SWEP.Secondary.Automatic = false
    SWEP.Secondary.Ammo = ""
    
-- Called when the SWEP is initialized.
function SWEP:Initialize()
    self:SetWeaponHoldType("melee");
    if (CLIENT) then
        self:CreateAttachments();
        self.Emitter = ParticleEmitter(Vector(0,0,0));
		if IsValid(self.Owner) then
			self:SendWeaponAH(self.ACT_VM_DEPLOY)
		end
    end
end
function SWEP:PrimaryAttack()

end
function SWEP:SecondaryAttack()

end

--[[ Clientside only from now on ]]--
if (SERVER) then
    return;
end

--[[ Torch Attachment ]]--
--[[
    -- First Author: Jvs
    -- URL: http://toybox.garrysmod.com/ingame/?view=2328&tab=code
    -- Notes:
        Cleaned up quite a bit
--]]
SWEP.VM = nil;
SWEP.WM = nil;
SWEP.HM = nil;
local model = "models/Gibs/furniture_gibs/FurnitureDrawer002a_gib05.mdl"
local scale = Vector(1,1,1.2)
local function fightMeCoward()
    local mdl = ClientsideModel(model, RENDER_GROUP_OPAQUE_ENTITY);
    mdl:SetNoDraw(true);
    mdl:SetModelScale(scale);
    return mdl;
end
function SWEP:CreateAttachments()
    if (not IsValid(self.VM)) then
        self.VM = fightMeCoward();
    end if (not IsValid(self.WM)) then
        self.WM = fightMeCoward();
    end 
end


SWEP.NextVMFire = 0;
local VMOffset = Vector(-1.5,3,5);
local VMFireOffset = Vector(1,-5,15);
local function calcOffset(ang, off)
    return ang:Right() * off.x + ang:Forward() * off.y + ang:Up() * off.z;
end
function SWEP:ViewModelDrawn()
    local owner = self.Owner;
    if (not (IsValid(owner) and IsValid(self.VM))) then
        return;
    end
    local vm = owner:GetViewModel();
    local matrix = vm:GetBoneMatrix(vm:LookupBone("ValveBiped.Bip01_R_Hand"));
    local ang = matrix:GetAngle();
    ang:RotateAroundAxis(ang:Forward(),180);
    local pos = matrix:GetTranslation();
    self.VM:SetRenderOrigin(pos + calcOffset(ang, VMOffset));
    self.VM:SetRenderAngles(ang);
    self.VM:DrawModel();
    local firepos = pos + calcOffset(ang, VMFireOffset);
    self:DoLight(firepos);
    local time = CurTime();
    if (time < self.NextVMFire) then
        return;
    end
    self.NextFire = time + 0.024;
    self:Particle(firepos, true);
end

local WMUpOffset = 15;
local WMFireUpOffset = 30

SWEP.HoldAng = Angle(0,0,0);
SWEP.NextWMFire = 0
function SWEP:DrawWorldModel()
    if (not IsValid(self.WM)) then
        return;
    end
    --[[
        -- First Author: Andrew McWatters
        -- URL: http://swep-bases.googlecode.com/
        -- Notes:
            I had to clean this up a bit too.
    -]]
    local owner = self.Owner;
    if (not IsValid(owner)) then
        return;
    end
    if ( not self.WMHans ) then
        self.WMHans = owner:LookupAttachment("anim_attachment_RH");
    end

    local hand = owner:GetAttachment(self.WMHans);
    if (not hand) then
        return;
    end
    local up = hand.Ang:Up();
    local offset = up * WMUpOffset
    --[[
    local offset =    -- hand.Ang:Right() * self.HoldPos.x +
                    -- hand.Ang:Forward() * self.HoldPos.y +
                       hand.Ang:Up() * self.HoldPos.z;

--    hand.Ang:RotateAroundAxis( hand.Ang:Right(),    self.HoldAng.x );
--    hand.Ang:RotateAroundAxis( hand.Ang:Forward(),    self.HoldAng.y );
--    hand.Ang:RotateAroundAxis( hand.Ang:Up(),        self.HoldAng.z );
--]]
    self.WM:SetRenderOrigin( hand.Pos + offset );
    self.WM:SetRenderAngles( hand.Ang );
    self.WM:DrawModel();
    self.HM:DrawModel();
    local firepos = hand.Pos + up * WMFireUpOffset;
    self:DoLight(firepos)
    local time = CurTime()
    if (time < self.NextWMFire) then
        return;
    end
    self.NextFire = time + 0.024;
    self:Particle(firepos);
end

--[[ Fire ]]--
--[[
    -- First Author: Microosoft
    -- Second Author: Robotboy655â„¢
    -- URL: http://toybox.garrysmod.com/ingame/?view=242&tab=code
--]]
function SWEP:Particle(pos, vm)
    if (not self.Emitter) then
        return;
    end
    local particle = self.Emitter:Add("effects/fire_cloud1",pos);
    if (not particle) then
        return;
    end
    particle:SetDieTime(1);
    particle:SetStartAlpha(128);
    particle:SetEndAlpha(0);
    if (vm) then
        particle:SetStartSize(7);
        particle:SetEndSize(0);
    else
        particle:SetStartSize(10);
        particle:SetEndSize(2);
    end
    particle:SetRoll(8);
    particle:SetRollDelta(math.Rand(-8,8));
    particle:SetAirResistance(256);
    particle:SetGravity(Vector(0,0,256));
end

--[[ Lighting ]]--
function SWEP:DoLight(pos)
    local dlight = DynamicLight( self:EntIndex() )
    if (not dlight ) then return; end
    dlight.Pos = pos
    dlight.r = 255
    dlight.g = 147
    dlight.b = 23
    dlight.Brightness = 5.9
    dlight.Decay = 420 * 5
    dlight.Size = 420
    dlight.DieTime = CurTime() + 1
end

//Jvs:stuff i just added,and,yes,all of these are shared

SWEP.CurrentAnim=nil;
SWEP.AnimationFrame=1;
SWEP.AnimTime=CurTime();

SWEP.ACT_VM_DEPLOY={
	[1]={
	['ValveBiped.Bip01_R_Finger41']=Angle(0,0,0),
	['ValveBiped.Bip01']=Angle(0,0,0),
	['ValveBiped.Bip01_R_UpperArm']=Angle(0,0,0),
	['ValveBiped.Bip01_R_Finger12']=Angle(0,-80.870002746582,0),
	['ValveBiped.Bip01_R_Finger2']=Angle(0,-57.389999389648,0),
	['ValveBiped.Bip01_R_Finger11']=Angle(0,-18.260000228882,0),
	['ValveBiped.Bip01_R_Finger21']=Angle(0,-26.090000152588,0),
	['ValveBiped.Bip01_R_Finger1']=Angle(0,-62.610000610352,0),
	['ValveBiped.Bip01_L_Clavicle']=Angle(0,0,0),
	['ValveBiped.Bip01_R_Finger22']=Angle(0,-86.089996337891,0),
	['ValveBiped.Bip01_R_Finger4']=Angle(-13.039999961853,-36.520000457764,0),
	['ValveBiped.Bip01_R_Finger42']=Angle(0,-18.260000228882,0),
	['ValveBiped.Bip01_R_Finger31']=Angle(0,-23.479999542236,0),
	['ValveBiped.Bip01_R_Finger0']=Angle(-5.2199997901917,26.090000152588,0),
	['ValveBiped.Bip01_R_Finger3']=Angle(0,-39.130001068115,0),
	['ValveBiped.Bip01_R_Finger32']=Angle(0,-52.169998168945,0),
		Duration=0.5,
	},

	[2]={
	['ValveBiped.Bip01_R_Finger41']=Angle(0,-28.700000762939,0),
	['ValveBiped.Bip01']=Angle(0,0,0),
	['ValveBiped.Bip01_R_UpperArm']=Angle(13.039999961853,-33.909999847412,33.909999847412),
	['ValveBiped.Bip01_R_Finger12']=Angle(0,-80.870002746582,0),
	['ValveBiped.Bip01_R_Finger2']=Angle(0,-57.389999389648,0),
	['ValveBiped.Bip01_R_Finger11']=Angle(0,-18.260000228882,0),
	['ValveBiped.Bip01_R_Finger21']=Angle(0,-26.090000152588,0),
	['ValveBiped.Bip01_R_Finger1']=Angle(0,-62.610000610352,0),
	['ValveBiped.Bip01_L_Clavicle']=Angle(0,0,0),
	['ValveBiped.Bip01_R_Finger22']=Angle(0,-86.089996337891,0),
	['ValveBiped.Bip01_R_Finger4']=Angle(-13.039999961853,-36.520000457764,0),
	['ValveBiped.Bip01_R_Finger42']=Angle(0,-18.260000228882,0),
	['ValveBiped.Bip01_R_Finger31']=Angle(0,-23.479999542236,0),
	['ValveBiped.Bip01_R_Finger0']=Angle(-5.2199997901917,26.090000152588,0),
	['ValveBiped.Bip01_R_Finger3']=Angle(0,-39.130001068115,0),
	['ValveBiped.Bip01_R_Finger32']=Angle(0,-52.169998168945,0),
		Duration=0
	}


}

local function GetNextFrame(self)
	/*what i need to do here is:
	increase animationframe
	check if animationframe is > #CurrentAnim then
		check if the currentanim got a FrameLoop
			set the animationframe to that frameloop
		otherwise set the animationframe to the end of the animation
	
	*/
	local nextframe=self.Weap.AnimationFrame
	if nextframe+1> #self.Weap.CurrentAnim then
		if self.Weap.CurrentAnim.FrameLoop then
			nextframe=self.Weap.CurrentAnim.FrameLoop
		end
	else
		nextframe=nextframe+1;
	end
	
	return nextframe;
end

local function AdvanceFrame(self)
	if CurTime()<self.Weap.AnimTime then return end
	self.Weap.AnimationFrame=GetNextFrame(self);
	self.Weap.AnimTime=CurTime()+self.Weap.CurrentAnim[self.Weap.AnimationFrame].Duration;
	return;
end

local function BuildBPositions(self)
	local Weap=self.Weap
	if !Weap.CurrentAnim then return end
	if !IsValid(LocalPlayer():GetActiveWeapon()) || LocalPlayer():GetActiveWeapon()!=self.Weap then return end
	for i,v in pairs(Weap.CurrentAnim[Weap.AnimationFrame])do
		
		//the for cycle here will see:
		//i,the bonename,or whatever is in the [frame] primary table,something like "ValveBiped.Bip01_Shit_like_that"
		//v,the content inside the *,so Angle(p,y,r)
		
		if type(v)=="Angle" then 
			local b = self:LookupBone(i)
			if b then
			local m = self:GetBoneMatrix(b)
				if m then
					
					//allright,so we need to interpolate to the next frame,so we can just use less frames and less choppy animations
					
					local ang=Angle(v.p,v.y,v.r);//fuuuu-,basically,this was the bug i was looking for,it was returning the original vector,not a copy of it
												 //and it was screwing up the animation

					//we need to get the rotation shit of the next frame of the same viewmodel bone

					local nextframe=GetNextFrame(self);
					local nextframeangle=Weap.CurrentAnim[nextframe]*

					//the angle table values are: p,y,r

					if nextframeangle then
						local frac=math.TimeFraction(Weap.AnimTime-Weap.CurrentAnim[Weap.AnimationFrame].Duration,Weap.AnimTime, CurTime() )
						ang.p=Lerp(frac,v.p,nextframeangle.p)
						ang.y=Lerp(frac,v.y,nextframeangle.y)
						ang.r=Lerp(frac,v.r,nextframeangle.r)
					end
					m:Rotate(ang)
					self:SetBoneMatrix(b,m)
				end
			end
		end
		
	end
	//Weap.DontDrawCSM=(Weap.CurrentAnim[Weap.AnimationFrame].DontDrawCSM) and true or false
	AdvanceFrame(self);
end

function SWEP:Deploy()
	self:SendWeaponAH(self.ACT_VM_DEPLOY)
	self:StupidSPFix("Deploy")
return true;
end

function SWEP:StupidSPFix(FunctName)
	if SERVER && SinglePlayer() then
	self:CallOnClient(FunctName,"")
	end
end

function SWEP:Holster()
	if CLIENT && IsValid(self.Owner) &&IsValid(self.Owner:GetViewModel())then
		self.Owner:GetViewModel().BuildBonePositions=nil;
	end
	return true;
end

function SWEP:OnDrop()
	if CLIENT && IsValid(self.Owner) &&IsValid(self.Owner:GetViewModel())then
		self.Owner:GetViewModel().BuildBonePositions=nil;
	end
end

function SWEP:OnRemove()
	if CLIENT && IsValid(self.Owner) &&IsValid(self.Owner:GetViewModel())then
		self.Owner:GetViewModel().BuildBonePositions=nil;
	end
end

function SWEP:Think()
	if CLIENT && IsValid(self.Owner:GetViewModel())then
		self.Owner:GetViewModel().Weap=self;
		self.Owner:GetViewModel().BuildBonePositions=BuildBPositions
	end
end

function SWEP:SendWeaponAH(ANIM)
	if !ANIM then return end
	//HAX,shouldn't the animation itself set the AnimTime on animation switching?
	self.AnimTime=CurTime()+ANIM[1].Duration;
	self.CurrentAnim=ANIM;
	self.AnimationFrame=1;

end

function SWEP:GetAHDuration()
	if !self.CurrentAnim then return end
	//this is fucking ugly,i hate to do this everytime a swep needs the duration,can't i just set a variable to something like... AnimDuration?
	local ahtime=0;
	for i,v in pairs(self.CurrentAnim)do
		if type(v)!="table" then continue; end
		ahtime=ahtime+v.Duration
	end
	return ahtime;
end



This is the link to my fixed version of the v_hands model,it does not contain any animation and has 2 attachments,making it perfect for my script.
I know,it’s kind of defeating the point of not downloading anything beside lua files,whatever.
http://www.mediafire.com/?6eee5thlt620tbn

Uh oh,looks like there’s a bug,it will not play again the deploy animation if it already played,i don’t get this error with my sweps,'cause i always switch animation after the deploy.
PS:i used the code in the first post.

Thank you. I will go through the code tomorrow.