Hakuren 0 Posted September 14, 2016 (edited) Hi hercules, Request : - Can i request a script that gives 5 different items in a array. Example : - i got setarray .@item_ids, 501,502,503,504,505,506,507,508,509,510; Randomly give 5 different items on that array at the sametime Thank you in advance. Edited September 14, 2016 by Hakuren Quote Share this post Link to post Share on other sites
0 Angery Woodpecker 1 Posted September 19, 2016 If the items can be repeated: setarray .@items , ....; for(.@i = 0; .@i < 5; ++.@i) getitem .@items[rand(getarraysize(.@items))],1; end;/close; If they cant be repeated: setarray .@items , ....; for(.@i = 0; .@i < 5; ++.@i){ .@removed = rand(getarraysize(.@items)); getitem .@items[.@removed],1; deletearray .@items[.@removed],1; } end;/close; just be sure that you use setarray everytime the script is called, since it removes from the array :3 Quote Share this post Link to post Share on other sites
Hi hercules,
Request :
- Can i request a script that gives 5 different items in a array.
Example :
- i got setarray .@item_ids, 501,502,503,504,505,506,507,508,509,510;
Randomly give 5 different items on that array at the sametime
Thank you in advance.
Edited by HakurenShare this post
Link to post
Share on other sites