Grenades not showing up in pointshop

Okay, so I co-own a TTT server and I just finished working on all of the weapons in the pointshop. I added in some colored smoke grenades because why not? However, they aren’t showing up at all.


ITEM.Name = 'Yellow Smoke'
ITEM.Price = 2500
ITEM.Model = 'models/weapons/w_eq_smokegrenade.mdl'
ITEM.WeaponClass = 'weapon_ttt_ylw_smokegrenade'
ITEM.SingleUse = false

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

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

That’s one of the codes. It [the format] worked flawlessy for every single gun, but when it came to the grenades they just don’t show up.

(And yes, they’re intended to be used multiple times)

Try creating a new category for these grenades. Also, make sure the weapon class is absolutely correct.

I’ll go create a seperate category for the grenades real quickly - I’ll update this post when I can actually test it.

And the weapon class should be correct, but if it was wrong it’d probably still show up in the pointshop. It just doesn’t show up. At all.

Have you tested that it works in TTT?

If you mean “Have you tested if the smokes work at all?” then yes, I have. I haven’t found a yellow one, but I’ve found pretty much every other color I added to the pointshop, and they worked flawlessly.

Anyways, I checked to see if making a category for just the smokes would work. It didn’t. :confused:

Do you think you could post the code to one of the grenades, or would you rather keep it private?

They’re not custom coded, we got it from the workshop so sure.

I’m not the best lua coder, so I’m pretty sure you need the shared.lua file in the ttt_weapon_ylw_smokegrenade, right?

I’ll post it here anyways :wink:


if SERVER then
   AddCSLuaFile( "shared.lua" )
end
   
SWEP.HoldType			= "grenade"

if CLIENT then
   SWEP.PrintName = "Yellow Smoke grenade"
   SWEP.Slot = 3

   SWEP.Icon = "VGUI/ttt/icon_nades"
end

SWEP.Base				= "weapon_tttbasegrenade"

SWEP.Spawnable = true
SWEP.AdminSpawnable = true

SWEP.WeaponID = AMMO_SMOKE
SWEP.Kind = WEAPON_NADE

SWEP.ViewModel			= "models/weapons/v_eq_smokegrenade.mdl"
SWEP.WorldModel			= "models/weapons/w_eq_smokegrenade.mdl"
SWEP.Weight			= 5
SWEP.AutoSpawnable      = false
-- really the only difference between grenade weapons: the model and the thrown
-- ent.

function SWEP:GetGrenadeName()
   return "ttt_ylw_smokegrenade_proj"
end


The smokes themselves work, they just don’t like the pointshop I guess.

This literally has no code that makes it any different than the regular smoke grenade. Can you please post a different color that you know works?

They’re all pretty much the same code, give or take a few differences.

Here’s the blue one.



if SERVER then
   AddCSLuaFile( "shared.lua" )
end
   
SWEP.HoldType			= "grenade"

if CLIENT then
   SWEP.PrintName = "Blue Smoke Grenade"
   SWEP.Slot = 3

   SWEP.Icon = "VGUI/ttt/icon_nades"
end

SWEP.Base				= "weapon_tttbasegrenade"

SWEP.Spawnable = true
SWEP.AdminSpawnable = true

SWEP.WeaponID = AMMO_SMOKE
SWEP.Kind = WEAPON_NADE

SWEP.ViewModel			= "models/weapons/v_eq_smokegrenade.mdl"
SWEP.WorldModel			= "models/weapons/w_eq_smokegrenade.mdl"
SWEP.Weight			= 5
SWEP.AutoSpawnable      = true
-- really the only difference between grenade weapons: the model and the thrown
-- ent.

function SWEP:GetGrenadeName()
   return "ttt_blu_smokegrenade_proj"
end


Also, the yellow one WORKS, it just doesn’t go into the pointshop, which is the point of this whole thread :stuck_out_tongue:

Are you sure that there isn’t any other code? The code your giving me doesn’t show any differences from the base grenade. Try


ITEM.WeaponClass = 'ttt_ylw_smokegrenade_proj'

I don’t think there is any difference in the code except the projectile. At all.

Anyways, I tried doing the class as the projectile rather then the weapon and it didn’t work, unsurprisingly to me.

I think you’re misunderstood on the problem though. The entire item just doesn’t show up.

http://puu.sh/5Ss8B.jpg

That’s the entire category, Every single weapon except the smoke shows and works perfectly. I used the exact same format for all of the weapons, the only thing I changed was the .lua file name, the weapon name, the weapon model and the weapon class. The code other then that was the same.

Now only if _Undefined would post a solution… :stuck_out_tongue: [not implying anything]

Just tested it on my server, everything works fine.

Mind posting the code you used? Or did you use what I posted?

Anyways, This isn’t a huge deal but it’d be pretty nice to figure out the source on this problem.

Your code. Try reextracting the workshop addon an making sure that both the weapon AND entity code is there. If you can’t fix it by tomorrow, I’ll zip up everything you need and send it to you.

When I get home I’ll try that. (currently on my iPod, wifi op)

Thanks for the help, though. Really appreciated :stuck_out_tongue:

Edit: Didn’t work ;(

Edit2: Actually, I think I did it wrong. I’ll try again later, busy atm.

Edit3: Oh my god, I think I figured out the problem!

I reviewed the code of all of my TTT weapons, and I realized one weapon that was also missing. The Pump Shotgun. I recently added the HL2 MP7 and Pistol to the permweapons and they didn’t work at first, so I did HL2-MP7 and HL2-Pistol and they worked. I didn’t realize this but the Pump Shotty is named Pump Shotgun.lua, no - or anything. The only other files named with spaces? The smokes.

I should learn lua more before complaining that it doesn’t work! :stuck_out_tongue:

Gonna keep this up incase someone else has a problem with this, though. Thanks for trying to help, though. Really appreciated <3