Hello everyone, I've been wondering how to add weapons into the pointshop on gmod. I add a Katana then when I go to buy it, it doesn't show in my inventory. Help?
bump
Post your pointshop code.
[QUOTE=code_gs;43116959]Post your pointshop code.[/QUOTE]
ITEM.Name = 'Katana'
ITEM.Price = 200
ITEM.Model = 'models/weapons/Katana.mdl'
ITEM.WeaponClass = 'weapon_crowbar'
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
Have you added the Katana as a weapon to your server, or is the pointshop code all you have?
[QUOTE=code_gs;43125298]Have you added the Katana as a weapon to your server, or is the pointshop code all you have?[/QUOTE]
Yea, I've done all that. I've added it to my server so it downloads in when on the loading screen, I've added it to the pointshop. Just won't let anyone equipt it when they buy it.
No, did you add it as a SWEP to the code?
[QUOTE=code_gs;43126783]No, did you add it as a SWEP to the code?[/QUOTE]
This is what I did: I added the minecraft swords to the pointshop like so:
ITEM.Name = 'GoldSword'
ITEM.Price = 15000
ITEM.Model = 'models/weapons/w_gold_mc_sword.mdl'
ITEM.WeaponClass = 'weapon_crowbar'
ITEM.SingleUse = false
function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
Then I added the steam ID code to addworkshop.lua
When I strip myself and buy the weapon, it gives me a crowbar.
Because w_gold_mc_sword is a world model, not a view model. You have to create a SWEP for the sword
[QUOTE=code_gs;43127250]Because w_gold_mc_sword is a world model, not a view model. You have to create a SWEP for the sword[/QUOTE]
How do I create the swep?
[QUOTE=WidowGaming;43127299]How do I create the swep?[/QUOTE]
Was the Minecraft Sword you got the model from a weapon?
[QUOTE=code_gs;43127440]Was the Minecraft Sword you got the model from a weapon?[/QUOTE]
Yes & also the server IP is: 95.154.240.51:27015 if you wan't to check everything to make sure.
ITEM.WeaponClass = 'weapon_crowbar'
Thats what is giving you the crowbar.
Make a swep or just edit crowbar and change the model to a viewmodel for the sword.
[QUOTE=AIX-Who;43127516]ITEM.WeaponClass = 'weapon_crowbar'
Thats what is giving you the crowbar.
Make a swep or just edit crowbar and change the model to a viewmodel for the sword.[/QUOTE]
How do I actually make a swep?
Take the code from whichever addon you got the model from.
[QUOTE=code_gs;43127614]Take the code from wherever you got the model from.[/QUOTE]
I don't get it, could you make a tutorial or something? Video/Text I don't mind aslong as you dont.
BUMP! I still need to know how to add sweps!
[QUOTE=code_gs;43127614]Take the code from whichever addon you got the model from.[/QUOTE]
I've got it, but where do I place it?
Post the code.
Sorry, you need to Log In to post a reply to this thread.