rakuzas Posted September 13, 2013 Share Posted September 13, 2013 Hello, Im going to give item as reward for my server event.. But i want to give random item.. But i notice getitem rand only give 1 of the 2 items.. Have any way to add more item like got 1 from 10 item ? Thanks.. Quote Link to comment Share on other sites More sharing options...
1 xienne15 Posted September 14, 2013 Share Posted September 14, 2013 (edited) Hello, Im going to give item as reward for my server event.. But i want to give random item.. But i notice getitem rand only give 1 of the 2 items.. Have any way to add more item like got 1 from 10 item ? Thanks.. Hmm try this~ Item_db: 644,Gift_Box,Gift Box,2,1000,,200,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc "randombox"; },{},{} Script: function script randombox { setarray .BoxItems[0],983,982,978,976,980,975,981; set .Random, rand( getarraysize( .BoxItems ) ); getitem .BoxItems[ .Random ], 1; end; } Please hit the reputation button if this works. -> Edited September 14, 2013 by xienne15 Quote Link to comment Share on other sites More sharing options...
0 Dolphin86 Posted April 20, 2020 Share Posted April 20, 2020 question, where should i add the script? inside npc/custom ? Quote Link to comment Share on other sites More sharing options...
Sanasol Posted September 13, 2013 Share Posted September 13, 2013 so add second getitem for this or try this { getrandgroupitem(IG_GiftBox),2; } *getrandgroupitem <group id>,<quantity>; Quote Link to comment Share on other sites More sharing options...
vivianlimfb Posted October 12, 2013 Share Posted October 12, 2013 Hello, Im going to give item as reward for my server event.. But i want to give random item.. But i notice getitem rand only give 1 of the 2 items.. Have any way to add more item like got 1 from 10 item ? Thanks.. Hmm try this~ Item_db: 644,Gift_Box,Gift Box,2,1000,,200,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc "randombox"; },{},{} Script: function script randombox { setarray .BoxItems[0],983,982,978,976,980,975,981; set .Random, rand( getarraysize( .BoxItems ) ); getitem .BoxItems[ .Random ], 1; end; } Please hit the reputation button if this works. -> i hv try and its work! thnx xinnie! Quote Link to comment Share on other sites More sharing options...
Hello,
Im going to give item as reward for my server event.. But i want to give random item.. But i notice getitem rand only give 1 of the 2 items.. Have any way to add more item like got 1 from 10 item ? Thanks..
Link to comment
Share on other sites