Help with pointshop item

I made this pointshop item intended to check and see if a player has a flaregun and if so to replace it with a “dragon” unfortunetly it is doing absolutly nothing. Help?


ITEM.Name = 'Flaregun Upgrade' 
ITEM.Price = 600 
ITEM.Model = 'models/weapons/w_physics.mdl' 
ITEM.SingleUse = true
ITEM.WeaponClass = 'dragon'

function ITEM:OnEquip(ply)
	if ply:HasWeapon( "weapon_ttt_flaregun" ) then
		ply:StripWeapon('weapon_ttt_flaregun')
		ply:Give(self.WeaponClass)
		ply:SelectWeapon(self.WeaponClass)
	end
end


Model doesn’t look right ‘models/weapons/w_physics.mdl’ I would try using “models/weapons/c_357.mdl” and Weapon Class doesn’t look right either.

Are you sure the weapon class is dragon?

[editline]4th February 2014[/editline]

It’s just a pointshop display. w_physics is fine.

Yeah, I give weapons in testing simple names so can spawn them quickly.

When they try to buy the weapon, does it say anything in console?

when it is supposed to work it says this:
1:
OnModify = function: 0x2cef65e8
OnBuy = function: 0x276c3b10
OnHolster = function: 0x2cef65d0
SingleUse = true
CanPlayerSell = true
ModifyClientsideModel = function: 0x2cef6600
OnEquip = function: 0x2d6ccd48
NoPreview = false
__index = table: 0x27735538
CanPlayerBuy = true
Price = 600
Name = Flaregun Upgrade
WeaponClass = dragon
AdminOnly = false
ID = dragon
OnSell = function: 0x27735560
AllowedUserGroups:
Model = models/weapons/w_physics.mdl
Category = Upgrades

when it is not it says this:
1:
OnModify = function: 0x2cef65e8
OnBuy = function: 0x276c3b10
OnHolster = function: 0x2cef65d0
SingleUse = true
CanPlayerSell = true
ModifyClientsideModel = function: 0x2cef6600
OnEquip = function: 0x2d6ccd48
NoPreview = false
__index = table: 0x27735538
CanPlayerBuy = true
Price = 600
Name = Flaregun Upgrade
WeaponClass = dragon
AdminOnly = false
ID = dragon
OnSell = function: 0x27735560
AllowedUserGroups:
Model = models/weapons/w_physics.mdl
Category = Upgrades

both the same.

It shouldn’t say that in console. I’m talking about the client console.

That is cut and paisted from my console, do you want the server console instead?

[editline]4th February 2014[/editline]

I did this



ITEM.Name = 'Flaregun Upgrade' 
ITEM.Price = 600 
ITEM.Model = 'models/weapons/w_physics.mdl' 
ITEM.SingleUse = true
ITEM.WeaponClass = 'dragon'

function ITEM:OnEquip(ply)
	ply:PrintMessage(HUD_PRINTTALK, "Equiped")
	if ply:HasWeapon( 'weapon_ttt_flaregun' ) then
	ply:PrintMessage(HUD_PRINTTALK, "Scanned")
		ply:StripWeapon('weapon_ttt_flaregun')
	ply:PrintMessage(HUD_PRINTTALK, "Stripped")
		ply:Give(self.WeaponClass)
	ply:PrintMessage(HUD_PRINTTALK, "Given")
		ply:SelectWeapon(self.WeaponClass)
	ply:PrintMessage(HUD_PRINTTALK, "Selected")
else
	ply:PrintMessage(HUD_PRINTTALK, "Failed")
	end
end


and nothing was printed to me when I bought it. Also server Rcon returns squat when I buy it.