Dolphin86 Posted November 18, 2023 Group: Members Topic Count: 274 Topics Per Day: 0.06 Content Count: 747 Reputation: 16 Joined: 01/07/12 Last Seen: July 29 Share Posted November 18, 2023 hello rathena, i need help on how should i turn this part of script from getting all of the item to random 1 item from the list. Spoiler setarray(.crafting_recipe_p1_t2_products, 40101, 1,40102, 1,40103, 1,40104, 1,40105, 1); Quote Link to comment Share on other sites More sharing options...
0 Winterfox Posted November 19, 2023 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 244 Reputation: 92 Joined: 06/30/18 Last Seen: 5 hours ago Share Posted November 19, 2023 // Change setarray(.crafting_recipe_p1_t2_products, 40101, 1,40102, 1,40103, 1,40104, 1,40105, 1); // to setarray(.crafting_recipe_p1_t2_products, 40101, 40102, 40103, 40104, 40105); setarray(.crafting_recipe_p1_t2_amounts, 1, 1, 1, 1, 1); // To handout 1 random item you do it like this: .@item_index = rand(getarraysize(.crafting_recipe_p1_t2_products)); getitem(.crafting_recipe_p1_t2_products[.@item_index], .crafting_recipe_p1_t2_amounts[.@item_ind//sex]); // To handout all items you do it like this: for(.@i = 0; .@i < getarraysize(.crafting_recipe_p1_t2_products); .@i++) { getitem(.crafting_recipe_p1_t2_products[.@i], .crafting_recipe_p1_t2_amounts[.@i]); } Quote Link to comment Share on other sites More sharing options...
Question
Dolphin86
hello rathena, i need help on how should i turn this part of script from getting all of the item to random 1 item from the list.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.