I'm completely stumped on this, it's run serverside and I'm using _undefined's pointshop. I'm trying to have someones weapons swapped on pickup if they have the ps item equipped.
[Code]
hook.Add( "WeaponEquip", "WeaponSwitch", function( ply, wep )
if ply:PS_HasItemEquipped("weap_awpa") then
if ply:HasWeapon( "weapon_awp" ) then
ply:StripWeapon( "weapon_awp" )
ply:Give( "weapon_awpa" )
end
end
end)
[/code]
When the hook runs it throws this error:
[code]
[ERROR] addons/pointshop/lua/autorun/server/weap_awpa.lua:4: attempt to call method 'PS_HasItemEquipped' (a nil value)
1. fn - addons/pointshop/lua/autorun/server/weap_awpa.lua:4
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
3. Give - [C]:-1
[/code]
Maybe I'm completely missing something, still a amateur coding in lua.
Are you sure that's the right function? Because that's what it's telling you is wrong that you're using and undefined function.
Yes, I've checked the Pointshop Documentation to make sure it was correct.
[url]http://pointshop.burt0n.net/player-meta-functions/items#has-item-equipped[/url]
Sorry, you need to Log In to post a reply to this thread.