Im trying to write a code that
-gives you a Pointshop item when you pickup weapons
-removes Pointshop items when you drop a weapon
Here is the code i wrote
local function getpickedupweapon(ply,wep)
if ply:PS_HasItem(wep:GetClass()..'_ps') then
return false
else
ply:PS_GiveItem(wep:GetClass()..'_ps')
return true
end
end
hook.Add('PlayerCanPickupWeapon', 'receive_pickedup_weapon', getpickedupweapon)
local function dropweaponremovesitem()
print('hi')
end
hook.Add('OnDrop', 'ins_dropwep_removes',dropweaponremovesitem)
The first part works just as i want it to, but droping the weapon does nothing (in this case it should print “hi” in the console)
I tried OnRemove/OnContextMenuOpen aswell, doesnt work either
No error code, no bugs, it just doesnt happen anything when you drop the weapon
Any idea for a fitting hook?