diff options
Diffstat (limited to 'tutorials/tut041_not_enough_items.md')
| -rw-r--r-- | tutorials/tut041_not_enough_items.md | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tutorials/tut041_not_enough_items.md b/tutorials/tut041_not_enough_items.md index 7b8a65f..650f6f6 100644 --- a/tutorials/tut041_not_enough_items.md +++ b/tutorials/tut041_not_enough_items.md @@ -4,14 +4,12 @@ It frequently happens that you want many items with only slight variations. In this tutorial we'll see how to create a item drop for every monster. We'll find all the npc's that the game knows about, and create an item (a corpse) for each one. -First, we need to find all the npc's the game knows about, then create an item for each one. - garrysmod/addons/artery\_rougelite/data/artery/global/npc\_corpses.lua local reg = nrequire("core/inventory/item.lua") local base = {} - base.Name = "Meat base" + base.Name = "Corpse base" base.weight = 10 @@ -27,10 +25,9 @@ garrysmod/addons/artery\_rougelite/data/artery/global/npc\_corpses.lua for k,v in pairs(allnpcs) do if k.Name then local item = table.Copy(base) --Make a copy of the above "base" table - item.Name = k.Name .. " Meat" --Give it a name of "<something> Meat" + item.Name = k.Name .. " Corpse" --Give it a name of "<something> Corpse" reg.RegisterItem(item) --Add it to the game end end That's it! Restart the gamemode, and use `artery_printitems` to see the items in console! - |
