User Tools

Site Tools


script_syntax

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
script_syntax [2021/05/05 12:17] justinscript_syntax [2021/05/05 12:37] justin
Line 98: Line 98:
 Deals 5 damage to each [[entity]] in the "slimes" [[groups|group]]. Deals 5 damage to each [[entity]] in the "slimes" [[groups|group]].
 <code bauxite> <code bauxite>
 +$item_list = array["ITEM_0001", "ITEM_0002", "ITEM_0003"];
 for $item_id in $item_list do for $item_id in $item_list do
    give_item($item_id);    give_item($item_id);
 end; end;
 </code> </code>
-Gives one of every item in $item_list to the player by iterating over the entire [[array]]. This assumes you have previously defined an $item_list variable that contains an [[array]] of [[string|string]] values for each item ID.+Gives one of every item in $item_list to the player by iterating over the entire [[array]].
 <code bauxite> <code bauxite>
 for $i in range(1, 4) do for $i in range(1, 4) do
script_syntax.txt · Last modified: 2023/11/06 14:13 by justin