We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d947c0 commit aeb29f8Copy full SHA for aeb29f8
.gitignore
@@ -0,0 +1 @@
1
+.DS_Store
lua/sh_pointshop.lua
@@ -89,6 +89,18 @@ function PS:LoadItems()
89
90
-- item hooks
91
92
+ for prop, val in pairs(ITEM) do
93
+ if type(val) == "function" then -- although this hooks every function, it doesn't matter because the non-hook functions will never get called
94
+ hook.Add(prop, 'PS_Item_' .. ITEM.Name .. '_' .. prop, function(...)
95
+ for _, ply in pairs(player.GetAll()) do
96
+ if ply:PS_HasItemEquipped(ITEM.ID) then -- hooks are only called if the player has the item equipped
97
+ ITEM[prop](ITEM, ply, unpack({...}))
98
+ end
99
100
+ end)
101
102
103
+
104
self.Items[ITEM.ID] = ITEM
105
106
ITEM = nil
0 commit comments