You don't have to declare c.sendMessage("Thank you for playing"); and the mystery box deleting 3 times. Can just call them once. Not that it matters, but should make it a switch statement
|
|
Spoiler for Mystery box:
Spoiler for crystal key:
I've tryed to explain everything in detail this is simple stuff so most of you wont even need this but this for beginners such as myself.
If you want a complex mystery box i suggest you go to this thread - [Only registered and activated users can see links. ]
credits
99 % me
1 % to the guy who told me how to do this : Misc.random(3)
You don't have to declare c.sendMessage("Thank you for playing"); and the mystery box deleting 3 times. Can just call them once. Not that it matters, but should make it a switch statement

and if the Misc.random == 0?
If people dont know how to use arrays:
/*Mystery box*/
if (itemId == 6199) { // item id
int mystbox = Misc.random(2); // How many options you want it to pick from
if (mystbox == 0) { // first option of 3
c.getItems().addItem(995, 10000000); //Adding items to inventory.
} else if (mystbox == 1) {
c.getItems().addItem(1050, 1);
} else if (mystbox == 2) {
c.getItems().addItem(1049, 3);
}
c.getItems().deleteItem(6199, 1); //Removes the mystery box from inventory
c.sendMessage("Thank you for playing"); //Sends a message after you open the mystery box
}
/*end of mystery box*/
i did say i was a beginner, Correct ?









| « [PI] Special Attack -percentile [PI] | Mithril seeds » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |