Rojen Posted July 16, 2018 Share Posted July 16, 2018 (edited) sec_in02,154,165,6 script Fishing Hole 723,{ //Fishing rod set .@Rod,2764; //Fishing Lure set .@Lure,2775; //Auto-Fish set .@Auto,1; //Auto-Fish on Fail set .@AutoFail,1; Fish: if (isequipped(.@Rod)) && (isequipped(.@Lure)){ specialeffect EF_BUBBLE,"Fishing Hole"; dispbottom "[Fishing] Baiting....."; set .@fcast,11; if (isequipped(2550)) { //Fisher's Muffler set .@fcast,.@fcast - 2; } if (isequipped(2443)) { //Fisher's Boots set .@fcast,.@fcast - 2; } if (isequipped(2764)) { //Fishing Rode set .@fcast,.@fcast - 3; } if (isequipped(2775)) { //Fishing Lure set .@fcast,.@fcast - 1; } progressbar "ffffff",.@fcast; if (rand(1,40) == 2){ getitem 26080,1; //Credit specialeffect2 EF_TEMP_OK; mapannounce strcharinfo(3),strcharinfo(0)+" has caught a ATM Credit Card x1!",bc_map,"0xff77ff"; } if (rand(1,40) == 2){ getitem 7227,5; //TCG specialeffect2 EF_TEMP_OK; mapannounce strcharinfo(3),strcharinfo(0)+" has caught TCG Cards x5!",bc_map,"0xff77ff"; } if (rand(1,50) == 2){ getitem 671,1; //Gold Coins specialeffect2 EF_TEMP_OK; mapannounce strcharinfo(3),strcharinfo(0)+" has caught a Gold Coin x1!",bc_map,"0xff77ff"; } if(.@Auto==1){ goto Fish;}else{ end;} } else { dispbottom "[Fishing] You need a Fishing Rod and Lure."; end; } } This is my script. Actually this script is working. I just don't understand the "rand" I want 10% for ATM Credit I want 5% for TCG Card and 1% for Gold Coin. PLEASE HELP! Edited July 16, 2018 by TheDerpySupport Codebox Quote Link to comment Share on other sites More sharing options...
0 TheDerpySupport Posted July 16, 2018 Share Posted July 16, 2018 Well this is my script you're using so It's relatively easy to understand; if (rand(0,9) == 2){ getitem 26080,1; //Credit specialeffect2 EF_TEMP_OK; mapannounce strcharinfo(3),strcharinfo(0)+" has caught a ATM Credit Card x1!",bc_map,"0xff77ff"; } This would be 10% rand(0,19) would be 5% and 1% would be rand(0,99) 1 Quote Link to comment Share on other sites More sharing options...
0 crazyarashi Posted July 16, 2018 Share Posted July 16, 2018 (edited) sec_in02,154,165,6 script Fishing Hole 723,{ //Fishing rod set [email protected],2764; //Fishing Lure set [email protected],2775; //Auto-Fish set [email protected],1; //Auto-Fish on Fail set [email protected],1; Fish: if (isequipped([email protected])) && (isequipped([email protected])){ specialeffect EF_BUBBLE,"Fishing Hole"; dispbottom "[Fishing] Baiting....."; set [email protected],11; if (isequipped(2550)) { //Fisher's Muffler set [email protected],[email protected] - 2; } if (isequipped(2443)) { //Fisher's Boots set [email protected],[email protected] - 2; } if (isequipped(2764)) { //Fishing Rode set [email protected],[email protected] - 3; } if (isequipped(2775)) { //Fishing Lure set [email protected],[email protected] - 1; } progressbar "ffffff",[email protected]; if (rand(1,10) == 2){ // 10% getitem 26080,1; //Credit specialeffect2 EF_TEMP_OK; mapannounce strcharinfo(3),strcharinfo(0)+" has caught a ATM Credit Card x1!",bc_map,"0xff77ff"; } if (rand(1,20) == 2){ // 5% getitem 7227,5; //TCG specialeffect2 EF_TEMP_OK; mapannounce strcharinfo(3),strcharinfo(0)+" has caught TCG Cards x5!",bc_map,"0xff77ff"; } if (rand(1,100) == 2){ 1% getitem 671,1; //Gold Coins specialeffect2 EF_TEMP_OK; mapannounce strcharinfo(3),strcharinfo(0)+" has caught a Gold Coin x1!",bc_map,"0xff77ff"; } if([email protected]==1){ goto Fish;}else{ end;} } else { dispbottom "[Fishing] You need a Fishing Rod and Lure."; end; } } Applying the basic math for percentage will do the trick. Edited July 16, 2018 by crazyarashi 1 Quote Link to comment Share on other sites More sharing options...
This is my script. Actually this script is working. I just don't understand the "rand"
I want 10% for ATM Credit
I want 5% for TCG Card
and 1% for Gold Coin.
PLEASE HELP!
Edited by TheDerpySupportCodebox
Link to comment
Share on other sites