So i am trying to make that only murder uses the knife and that players cannot use it on the server but only murder and everytime i try here what i get
[ERROR] addons/pointshop-master/lua/pointshop/items/weapons/csgo_bayonet.lua:1: attempt to index global 'ITEM' (a nil value)
Here Is my Cody
ITEM.Name = 'Bayonet Knife'
ITEM.Price = 20000
ITEM.Model = 'models/weapons/w_csgo_bayonet.mdl'
ITEM.WeaponClass = 'csgo_bayonet'
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
function ITEM:OnEquip(ply)
if !ply:GetMurderer() then
ply:StripWeapon(self.WeaponClass)
return false
end
ply:PS_Notify('Sorry but you cannot equip that item as Murderer.')
return false
end
I would be thank full if someone can help me out with this youRock
Is the Murderer meant to buy the knife first, or is he meant to spawn with it without paying?
The murderer meant to buy the knife first but the problem is that even if he bought it and that player cannot equip it and use it i just want to put it only for the murders that can use it and buy it not the bystanders (players)
[code]
function ITEM:OnEquip(ply)
if !ply:GetMurderer() then
ply:StripWeapon(self.WeaponClass)
ply:GiveWeapon("weapon_knife")
ply:PS_Notify('Sorry but you cannot equip that item as Murderer.')
end
[/code]
Could give this a go?
Thank you i'm gonna try it out i will respond if it works
I updated it to work a bit better. I missed out an end. It is really hard to use my phone keyboard as it corrects spelling errors and fucks the code up
Thanks for the code it works but there is still some sort of a problem when it comes to the murder still even if i got the knife buyed and in my inventory when i equip it it doesn't show all the time the first round does but later when the next round comes it doesn't show idk if it's a bug or something else?
It has been years since I used pointshop I think it had problems with round based gamemodes. You could try searching for melee or knife scripts for Pointshop on Google for TTT or any other round based gamemodes that are popular.
Will do thanks for the help and have an amazing night or day kind sir youRock!
Sorry, you need to Log In to post a reply to this thread.