Lua Error Please Help

[weapons\weapon_bn4_base\shared.lua:44] attempt to call method ‘SetWeaponHoldType’ (a nil value)

LINE :

local function setHoldType ( UMsg )
local ent = UMsg:ReadEntity()
local holdType = UMsg:ReadString()

if (!ent || !ent:IsValid()) then return end

ent:SetWeaponHoldType(holdType)  <= LINE 44

end

please help.


local function setHoldType ( UMsg )
local ent = UMsg:ReadEntity()
local holdType = UMsg:ReadString()

if (!ent || !ent:IsValid()) then return end

ent:SetWeaponHoldType( UMsg ) 
end

I’m not an expert as i havn’t done lua in a few years, But i suppose that should fix it…

Thank you.