User Tools

Site Tools


give_item

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
give_item [2020/02/19 09:40] justingive_item [2023/04/26 12:19] justin
Line 6: Line 6:
 ====Signature:==== ====Signature:====
 <code python> <code python>
-give_item(item_id, count)+give_item(item_id, count, character)
 </code> </code>
  
 ^Argument^Description^Type^Required^ ^Argument^Description^Type^Required^
 |item_id|ID of the [[item]] (as defined in the [[Item Editor]]).|[[String]]|Yes| |item_id|ID of the [[item]] (as defined in the [[Item Editor]]).|[[String]]|Yes|
-|count|How many of the [[item]] to give to the player.|[[Number]]|No|+|count|How many of the [[item]] to give to the player (defaults to 1).|[[Number]]|No
 +|character|[[Character]] the [[item]] will be given to (defaults to the main [[player character]]).|[[Entity]]|No| 
 + 
 +^Return Value^Description^Type^ 
 +|Number Given|Returns the actual number of [[item|items]] that were given to the player. This could be less than the count supplied to the function, for example if the player's [[inventory]] becomes full.|[[Number]]|
  
 ====Example:==== ====Example:====
 <code bauxite> <code bauxite>
-give_item("ITEM_0007", 5)+give_item("ITEM_0007", 5);
 </code> </code>
 //Results:// Five of ITEM_0007 are placed into the player's [[inventory]]. //Results:// Five of ITEM_0007 are placed into the player's [[inventory]].
give_item.txt · Last modified: 2023/04/26 12:22 by justin