Rojen Posted July 16, 2018 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 9 Reputation: 0 Joined: 05/22/18 Last Seen: June 19, 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 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 208 Reputation: 60 Joined: 09/23/17 Last Seen: July 28, 2021 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 Group: Developer Topic Count: 50 Topics Per Day: 0.02 Content Count: 776 Reputation: 239 Joined: 02/11/17 Last Seen: 18 hours ago 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,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(.@Auto==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...
Question
Rojen
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!
Codebox
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.