Jump to content
  • 0

Gift Box Give Random Item?


Question

Posted

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..

4 answers to this question

Recommended Posts

  • 1
Posted (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 by xienne15
Posted

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!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...