|
well i made this so far: when you att you got a chance of rectiving coins(it's a minigame) and i put it in a ratio of 4:3 (in 4 att it happens 3 times) BUT it is only happening on a ratio of 4:1 (in 4 att only happen 1 time)
here is my code:
why it happens only in 4:1 and not 4:3?Code:public void cashh4x(){ if(playerEquipment[playerCape] == 8022){ if (misc.random(4) == 3){ addItem(995, 1000000); } } }
like this?
if (misc.random(4) == 6){
EDIT: than it don't happen at all
I don't know why but ill try:
Synchronization problem?
why it would be? i just did this:
obs that's ava's effect just hided for leechers:
"jagex states than we keep 80% of the arrows we shot"
so:
80% = in 100 shots you keep 80 arrows
simplified
100/10 80/10
in 10 shots we keep 8 arrows
10/2 8/2
in 5 shots we keep 4 arrows
(OOPS figured out i put the wrong number but i think the prob will b the same)
Go into item2.java and add something like this:
Now find this:Code:public static int pkDrop[] = {995}; public static int randompkDrop() { return pkDrop(int)(Math.random()*pkDrop.length)]; } }
Change that too:Code:public void cashh4x(){ if(playerEquipment[playerCape] == 8022){ if (misc.random(6) == 4){ addItem(995, 1000000); } } }
Try thatCode:public void cashh4x(){ if(playerEquipment[playerCape] == 8022){ if(misc.random(2) == 7) { addItem(item2.randompkDrop, 1000000); } } }
that would aways add the cash =] anyways i made a better code and worked out thanks all for helping
public void cashh4x(){
if(playerEquipment[playerCape] == 8022){
if (misc.random(4) == 3){
addItem(995, 1000000);
}
}
}
misc.random returns 1 number not like.. the first 3 and also it includes 0 so you're looking at a 1 in 5 chance with that code...
Simple. misc.random returns 1 number, so when you put 4 it returns EITHER a 1,2,3,or a 4. You have to check for 3 of the numbers not just one.Code:public void cashh4x(){ if(playerEquipment[playerCape] == 8022){ if (misc.random(4) == 1 || misc.random(4) == 2 || misc.random(4) == 3){ addItem(995, 1000000); } } }
~I lyfe I.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |