HoldType Problem !

I created a weapon but in the third person the hold type are the pistol then my wants grenade holdtype


function SWEP:Initialize()
     self:SetWeaponHoldType("grenade")
end

I believe that until the update is out, you need to set the holdtype both on the client and server

-snip-

I change the code to


function SWEP:Initialize()
     self:SetWeaponHoldType("grenade")
end

But this create a error look at it


 addons/bottle/lua/weapons/weapon_bottle/init.lua:11: attempt to call method 'SetHoldType' (a nil value)
  1. unknown - addons/bottle/lua/weapons/weapon_bottle/init.lua:11
   2. Give - [C]:-1
    3. unknown - gamemodes/sandbox/gamemode/commands.lua:708
     4. unknown - lua/includes/modules/concommand.lua:69



That’s only available in the next update, it should come out soon hopefully.

?

Its ok but for my code can you help me ?

And i have a question when the update will come

Yeah, I apologise. I was mainly trying to state that SetWeaponHoldType was changing to SetHoldType.

[editline]9th July 2014[/editline]

self:SetWeaponHoldType(“grenade”) should work until the update comes out hopefully soon where you will then have to use SetHoldType instead. Are you getting any errors in the console?

Since the update is out, use self:SetHoldType(“grenade”)

The problem has not solved look i change the code


AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )

include('shared.lua')

SWEP.Weight				= 3
SWEP.AutoSwitchTo			= true
SWEP.AutoSwitchFrom			= true
SWEP.HoldType 			= "grenade"


function SWEP:Initialize()
	self:SetHoldType( self.HoldType )
end


function SWEP:OnRemove()
end



Make sure SWEP:Initialize does not exist in any other SWEP files for that SWEP.

Yes Thank you dude show 2 SWEP:Initialize and i deleted one