i search on forum how to create a custom box (like obb), and i read about using function to create it.
what i gonna ask is, is it possible to get random item on same percentage?
i've implement this function (script) on my server :
function script PrizeBox {
setarray .BoxItems[0],501,502,503,504;
set .rand, rand(100);
if (.rand <= 5){
getitem .BoxItems[0],1;}
if (.rand <= 10 && .rand > 5){
getitem .BoxItems[1],1;}
if (.rand <= 25 && .rand > 10){
getitem .BoxItems[2],1;}
if (.rand > 25){
getitem .BoxItems[3],1;
getitem .BoxItems[2],1;}
end;
}
in this function, i just can get only one item (like red potion). how about if i want to get random item on same percentage? for example, if .rand <= 5 , i have a chance to get random item like red potion, aloe leaflet, mastela fruit?
i've try to add 1 more line , (the red font) but it just give me two item together X_X.
Question
shinz
hello, sorry for asking help again
i search on forum how to create a custom box (like obb), and i read about using function to create it.
what i gonna ask is, is it possible to get random item on same percentage?
i've implement this function (script) on my server :
in this function, i just can get only one item (like red potion). how about if i want to get random item on same percentage? for example, if .rand <= 5 , i have a chance to get random item like red potion, aloe leaflet, mastela fruit?
i've try to add 1 more line , (the red font) but it just give me two item together X_X.
Link to comment
Share on other sites
2 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.