I use this Pointshop Script for my SWEP to equip on each round
[lua]
ITEM.Name = 'AK47'
ITEM.Price = 500000
ITEM.Model = 'models/weapons/w_rif_ak47.mdl'
ITEM.WeaponClass = 'weapon_ttt_ak47'
ITEM.SingleUse = false
function ITEM:OnEquip(ply)
if ply:IsPlayer() and ply:IsTerror() and ply:Alive() then
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
end
function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end
[/lua]
But sometimes I spawn on a place theres already a gun then I get the gun laying on that place instead of the buid gun!
I want the gun to remove automatically and equip the buid gun.
I tried severall codes but nothing seemed to work.
Could anyone help me please :)?
Thanks for every suggestion, deinemudda32
[CODE]ply:Strip(self.WeaponClass)[/CODE]
That wouldnt work because it would strip the weapon themself also if I find an AWP at the start of the round it wouldnt be stripped and the ak47 wont be equipped.
Between youre code is wrong that would be:
[lua]ply:StripWeapon(self.WeaponClass)[/lua]
So youres is double wrong :D
[QUOTE=deinemudda32;44716129]That wouldnt work because it would strip the weapon themself also if I find an AWP at the start of the round it wouldnt be stripped and the ak47 wont be equipped.
Between youre code is wrong that would be:
[lua]ply:StripWeapon(self.WeaponClass)[/lua]
So youres is double wrong :D[/QUOTE]
Ah I forgot Weapon. Ya got me.
Check to see if their current weapon is equal to the self.WeaponClass. If it isn't, then StripWeapon. Else just don't do anything.
Sorry, you need to Log In to post a reply to this thread.