What is the point of adding a random value when it can only be 0..?
|
|
OK so I want to make a mystery box that gives you all items. I want to use the object instead of item. The object ID is 357 and I want the items to go from 0 to 20072 and for now to be player rights 3. For example, when I click on the box I have an 100% chance of getting any item that exists but only 1 of the item. I already know that it looks something like this when declaring:
however I could be wrong. I do have skype and teamview so I can pm details. All help is appreciated.Code:public int mysteryBox() { return mysteryBox[(int) (Misc.random(0) + 20072)];
I want to make it so I can get item 0-20072 at random
pretty pointless man no offence.
I tried that and it says "cannot find symbol : variable mysteryBox"
and I also need the switch statement so an action occurs when object 357 is clicked.
Code:player.addItem(Misc.random(20072), 1);
thank you doors, it works, however is there anyway so I can add an exception to the switch:
so I dont get null items?Code:case 357: if (c.playerRights == 3) { c.getItems().addItem(mysteryBox(),Misc.random(1)); }
I got mine to work but I am wondering if I can make it so items with the name "null" wont be in the box.
| « [PI] Adding pets. | player hop problem [pi] » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |