Pointshop adding perm weapons

Does any one know how to make it so that pointshop weapons are perm on purchase for certain people?

I tried this script but the weapon gets removed at the end of round and when the round starts, it will say that i can either holster it or sell it, no equip. The only way to get it back is to sell it and equip it again. Is there a way to make it permanetly stick onto you? But gets removed when in spectating mode so that people cant see it.

ITEM.Name = ‘GRAPPLEHOOK’
ITEM.Price = 100
ITEM.Model = ‘models/weapons/v_crossbow.mdl’
ITEM.WeaponClass = ‘grapplehook’
ITEM.SingleUse = false
ITEM.AllowedUserGroups = { “vip”, “superadmin” }

function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnEquip(ply)
ply:SelectWeapon(self.WeaponClass)
end

does the same for me on characters I just holster it and re-equip it and it works just gotta do that at the start of every round but im sure theres a way to make it so nobody has to do that

can anyone help me?

It’s because you’re running the ply:Give() function on the buy. You need to run it on the function ITEM:OnEquip(ply)

Try this



ITEM.Name = 'GRAPPLEHOOK'
ITEM.Price = 100
ITEM.Model = 'models/weapons/v_crossbow.mdl'
ITEM.WeaponClass = 'grapplehook'
ITEM.SingleUse = false
ITEM.AllowedUserGroups = { "vip", "superadmin" }

function ITEM:OnBuy(ply)

end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end


P.S Next time post in http://facepunch.com/forums/65

Thanks it works !