Set items to chest?
#4
-- ChestX, ChestY and ChestZ are coords of the chest, obtained elsewhere
cWorld:DoWithChestAt(ChestX, ChestY, ChestZ,
  function (a_ChestEntity)
    a_ChestEntity:SetSlot(0, 0, cItem(E_BLOCK_GOLD_BLOCK))  -- gold block to upper left slot
    a_ChestEntity:SetSlot(1, 0, cItem(E_ITEM_DIAMOND_SWORD, 500))  -- half-broken diamond sword to slot [1, 0]
    a_ChestEntity:SetSlot(3, cItem(E_ITEM_BOW)) -- regular bow to slot #3 ([3, 0], fourth slot)
    a_ChestEntity:SetSlot(math.random(27), cItem(256 + math.random(50)))  -- completely random item to a random slot
  end
)
Reply
Thanks given by:


Messages In This Thread
Set items to chest? - by agusnat16 - 03-19-2014, 05:13 PM
RE: Set items to chest? - by xoft - 03-19-2014, 07:06 PM
RE: Set items to chest? - by agusnat16 - 03-19-2014, 09:23 PM
RE: Set items to chest? - by xoft - 03-19-2014, 10:32 PM
RE: Set items to chest? - by agusnat16 - 03-19-2014, 11:16 PM
RE: Set items to chest? - by xoft - 03-20-2014, 12:16 AM
RE: Set items to chest? - by agusnat16 - 03-20-2014, 12:27 AM
RE: Set items to chest? - by xoft - 03-20-2014, 04:25 AM
RE: Set items to chest? - by agusnat16 - 03-20-2014, 01:57 PM
RE: Set items to chest? - by xoft - 03-20-2014, 06:09 PM



Users browsing this thread: 4 Guest(s)