Does anyone have the code for permanent weapons for point shop. (I'm using the original pointshop here's the weapon file."
[CODE]ITEM.Name = 'Diamond Sword'
ITEM.Price = 125000
ITEM.Model = 'models/weapons/w_diamond_mc_sword.mdl'
ITEM.WeaponClass = 'mc_sword_diamond'
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
[/CODE]
What would I need to add to make it a permanent weapon where you spawn with it.
ITEM.SingleUse is gawdawful. Try this
[CODE]ITEM.Name = 'CS:S Knife'
ITEM.Price = 20000
ITEM.Model = 'models/weapons/w_knife_t.mdl'
ITEM.WeaponClass = 'weapon_knife'
function ITEM:OnEquip(ply)
ply:StripWeapon('weapon_knife') -- Remove this if you're not replacing the melee weap
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
ply:Give('weapon_knife') -- Remove this if you're not replacing the melee weap
ply:SelectWeapon('weapon_knife') -- Remove this if you're not replacing the melee weap
end[/CODE]
Note its not mine, got it off another facepunch thread and have used it since.
You already did. "SingleUse = false". Done, the person just has to buy & equip it.
[editline]29th July 2015[/editline]
Awh cmon why you all post whilst I write?!
SingleUse set to false or nil should do the trick.
norriskirby is right. Essentially you need to swap OnBuy and OnSell to OnEquip and OnHolster for permanent weapons.
Single use doesn't equip on spawn and it doesn't even show up on spawn maybe if I removed the freeze time it would work. But some maps need the freeze time. I'm gonna try to use that code.
[editline]29th July 2015[/editline]
Code works. Thanks!:mindblown:
[QUOTE=norriskirby;48324223]ITEM.SingleUse is gawdawful. Try this
[CODE]ITEM.Name = 'CS:S Knife'
ITEM.Price = 20000
ITEM.Model = 'models/weapons/w_knife_t.mdl'
ITEM.WeaponClass = 'weapon_knife'
function ITEM:OnEquip(ply)
ply:StripWeapon('weapon_knife') -- Remove this if you're not replacing the melee weap
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
ply:Give('weapon_knife') -- Remove this if you're not replacing the melee weap
ply:SelectWeapon('weapon_knife') -- Remove this if you're not replacing the melee weap
end[/CODE]
Note its not mine, got it off another facepunch thread and have used it since.[/QUOTE]
If I have a rainbow shotgun, what should i put in place of "weapon_knife" or do i just delete the whole line?
[QUOTE=Supernic212;48423473]If I have a rainbow shotgun, what should i put in place of "weapon_knife" or do i just delete the whole line?[/QUOTE]
"weapon_rainbow_shotgun" (but it can be whatever you want it to be)
[QUOTE=JasonMan34;48423496]"weapon_rainbow_shotgun" (but it can be whatever you want it to be)[/QUOTE]
Thanks everyone! got it to work.
Sorry, you need to Log In to post a reply to this thread.