Help!

Post Reply
Trooper
A semi-regular
A semi-regular
Posts: 16
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Jun 14, 2013 4:19 pm

Help!

Post by Trooper »

Ok so I am trying to code this Gail into the TTT point shop So far I have the icon and the gun in the shop but when I buy it, it never spawns or equips. Here is my code I need some help!


ITEM.Name = 'Gail'
ITEM.Price = 500
ITEM.WeaponClass = 'weapon_ar2'
ITEM.Model = 'models/weapons/v_rif_galil.mdl'
ITEM.Material = 'materials/weapons/weapon_mad_galil.vmt'
ITEM.SingalUse = true

function ITEM:OnBuy(ply)
ply:Give(self.Weapon)
end

// Equiping when you go to buy the gun it Equips.

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


function ITEM.OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end
furntree
Compulsive poster
Compulsive poster
Posts: 74
Joined: Fri May 24, 2013 7:41 pm

Re: Help!

Post by furntree »

I am not sure if this is the solution to your issue however you have a typo

ITEM.Name = 'Gail'

should be...

ITEM.Name = 'Galil'
Trooper
A semi-regular
A semi-regular
Posts: 16
Joined: Fri Jun 14, 2013 4:19 pm

Re: Help!

Post by Trooper »

That is just the name of the item
But I will fix it
SaintSin
New to forums
New to forums
Posts: 8
Joined: Mon May 27, 2013 5:08 pm

Re: Help!

Post by SaintSin »

Make sure ITEM.WeaponClass is the folder that contains the SWEP (shared.lua)

Here is my pointshop galil
ITEM.Name = 'Galil'
ITEM.Price = 55
ITEM.Model = 'models/weapons/w_rif_galil.mdl'
ITEM.WeaponClass = 'weapon_ttt_galil'
ITEM.SingleUse = true


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

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