rakuzas Posted September 13, 2013 Group: Members Topic Count: 152 Topics Per Day: 0.03 Content Count: 459 Reputation: 7 Joined: 06/29/12 Last Seen: April 25, 2019 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 Group: Members Topic Count: 44 Topics Per Day: 0.01 Content Count: 226 Reputation: 11 Joined: 01/09/12 Last Seen: March 15, 2018 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 Group: Members Topic Count: 280 Topics Per Day: 0.06 Content Count: 757 Reputation: 17 Joined: 01/07/12 Last Seen: December 18, 2024 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 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 185 Reputation: 53 Joined: 01/04/12 Last Seen: February 28 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 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 1 Reputation: 0 Joined: 09/28/13 Last Seen: November 16, 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...
Question
rakuzas
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
4 answers 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.