User Tools

Site Tools


add_item_to_container

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
add_item_to_container [2019/12/23 22:04]
justin
add_item_to_container [2020/01/17 09:45] (current)
justin
Line 2: Line 2:
 ---- ----
  
-Adds one or more of the specified item to an item container. The ID of the item is case-sensitive and should match the ID assigned to it in the [[item_editor|Item Editor]] (e.g. "​ITEM_0001"​). The item will be placed into the first open slot of the player'​s inventory.+Adds one or more of the specified item to an item container. The ID of the item is case-sensitive and should match the ID assigned to it in the [[item_editor|Item Editor]] (e.g. "​ITEM_0001"​). The item will be placed into the first open slot of the container.
  
 ====Signature:​==== ====Signature:​====
Line 15: Line 15:
  
 ====Example:​==== ====Example:​====
-<​code ​python+<​code ​lua
-add_item_to_container("​wooden_chest"​, "​ITEM_0001", ​2)+add_item_to_container(self, "​ITEM_0001", ​1)
 </​code>​ </​code>​
-//​Results:// ​Two of ITEM_0001 ​are placed into the "​wooden_chest" ​container entity.+//​Results:// ​One of ITEM_0001 ​is placed into the container entity ​from which the script was triggered.
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
Line 29: Line 29:
 <WRAP half column> <WRAP half column>
 ====Editor Node:==== ====Editor Node:====
-{{:wiki:give_item_node.png?​nolink|}}+{{:wiki:add_item_to_container_node.png?​nolink|}}
 </​WRAP>​ </​WRAP>​
  
add_item_to_container.1577167497.txt.gz · Last modified: 2019/12/23 22:04 by justin