diff options
Diffstat (limited to 'gamemode/inventorysystem')
| -rw-r--r-- | gamemode/inventorysystem/exampleinventory.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gamemode/inventorysystem/exampleinventory.lua b/gamemode/inventorysystem/exampleinventory.lua index b8c539f..1e4af47 100644 --- a/gamemode/inventorysystem/exampleinventory.lua +++ b/gamemode/inventorysystem/exampleinventory.lua @@ -3,6 +3,7 @@ --@classmod invtbl local inv = {} +local reg = nrequire("inventory.lua") ---Inventory name. -- All inventories must have a name, names must be unique per TYPE of inventory. @@ -85,7 +86,7 @@ end -- Returns a string that the inventory can be rebuilt from. This should include all items currently in the inventory. Take advantage of the fact that items must also have a Serailize() method. --@tparam invtbl self The instance of the inventory to serialize --@treturn string The string representation of this inventory -function inv.Serailize(self) +function inv.Serialize(self) local items = {} for k,v in pairs(self.items) do items[k] = {v.Name,v:Serialize()} @@ -108,4 +109,4 @@ function inv.DeSerialize(self,str) return cpy end -RegisterInventory(inv) +reg.RegisterInventory(inv) |
