User Tools

Site Tools


lua:ch:inventory

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
lua:ch:inventory [2014/12/24 04:43] – created aethynlua:ch:inventory [2014/12/24 04:57] (current) aethyn
Line 1: Line 1:
-Returns a table of [[:triggers:lua:obj:members|OBJ]]s.+Returns a table of [[:lua:obj:members|OBJ]]s.
  
 Example: Example:
  
-Looping through a PCs inventory to look for an item with vnum 100:+Loop through a PC'inventory and remove items with vnum 100
  
-''for _,object in ipairs(ch.inventory) do''+<code lua>for _,object in ipairs(ch.inventory) do
  
- ''if object.vnum == 100 then''+  if object.vnum == 100 then
  
-  ''-- do something''+    object:destroy()
  
-''end''+  end
  
-''end''+end 
 +</code>
  
lua/ch/inventory.1419396230.txt.gz · Last modified: 2014/12/24 04:43 by aethyn