I want to create a box or egg that gives 1 item from a 10 item pool with adjustable percentage chance.
This is the closest script that I've found from the forum, script is commented back in 2014.
switch(rand(0,3)){// 4 choices: no bonus, Mask, Glove, Beltcase1:if(rand(0,100)<15) getitem 5482,1;break;// player will get Dark Knight Mask. but, 15% chance (random, 0~99. if number is < 15, get)case2:if(rand(0,100)<5) getitem 2780,1;break;// player will get Dark Knight Glove. but, 5% chance (random, 0~99. if number is < 5, get)case3:if(rand(0,100)<5) getitem 2780,1;break;// player will get Dark Knight Belt. but, 5% chance (random, 0~99. if number is < 5, get)default:end;}// player did not get any bonus
Just wondering if there is an easier script to work with or?
Example chance structure (thinking if it needs to be a total of 100%)
item1 - 1%
item2 - 4%
item3 - 5%
item4 - 10%
item5 - 10%
item6 - 10%
item7 - 15%
item8 - 15%
item9 - 15%
item10 - 15%
Question
kevinyrchua
Hi!
I want to create a box or egg that gives 1 item from a 10 item pool with adjustable percentage chance.
This is the closest script that I've found from the forum, script is commented back in 2014.
Just wondering if there is an easier script to work with or?
Edited by kevinyrchuaExample chance structure (thinking if it needs to be a total of 100%)
item1 - 1%
item2 - 4%
item3 - 5%
item4 - 10%
item5 - 10%
item6 - 10%
item7 - 15%
item8 - 15%
item9 - 15%
item10 - 15%
Link to comment
Share on other sites
8 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.