Erebos Posted January 28, 2019 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 65 Reputation: 4 Joined: 10/25/18 Last Seen: Friday at 01:38 AM Share Posted January 28, 2019 - script cashmvp -1,{ OnInit: .randcash == rand(10,20); OnNPCKillEvent: if( getmonsterinfo( killedrid,MOB_MVPEXP )){ atcommand "@cash" .randcash; dispbotton .randcash; end; } } Can't make it work, its supposed to give a random amount of cash, between 10 and 20 every time a player kils an MVP monster. And show a message of how much cash the player got. Quote Link to comment Share on other sites More sharing options...
0 utofaery Posted January 28, 2019 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 228 Reputation: 19 Joined: 10/27/12 Last Seen: March 17, 2019 Share Posted January 28, 2019 (edited) 50 minutes ago, Brizyous said: - script cashmvp -1,{ OnInit: .randcash == rand(10,20); OnNPCKillEvent: if( getmonsterinfo( killedrid,MOB_MVPEXP )){ atcommand "@cash" .randcash; dispbotton .randcash; end; } } Can't make it work, its supposed to give a random amount of cash, between 10 and 20 every time a player kils an MVP monster. And show a message of how much cash the player got. dispbottom instead of dispbotton??? Update: Should be good. Quote - script cashmvp -1,{ OnNPCKillEvent: .@mobIDK = killedrid; //dispbottom (" killedrid :: " + killedrid ); if ( getmonsterinfo( .@mobIDK , MOB_MVPEXP) > 0 ) { .@a = callfunc("F_Rand",100,200); atcommand ("@Cash " + .@a); dispbottom ("Increased Cash " + .@a ); } end; } Edited January 28, 2019 by utofaery 1 Quote Link to comment Share on other sites More sharing options...
0 Erebos Posted January 28, 2019 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 65 Reputation: 4 Joined: 10/25/18 Last Seen: Friday at 01:38 AM Author Share Posted January 28, 2019 (edited) Thanks! it worked but i get either 100 or 200 cash, how do i make so i get a random number from 100 to 200? edit: i figured it out thanks! Edited January 28, 2019 by Brizyous Quote Link to comment Share on other sites More sharing options...
0 utofaery Posted January 28, 2019 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 228 Reputation: 19 Joined: 10/27/12 Last Seen: March 17, 2019 Share Posted January 28, 2019 my bad change 100 and 200 to anything. - script cashmvp -1,{ OnNPCKillEvent: .@i1 = 100; .@i2 = 200; if ( getmonsterinfo( killedrid , MOB_MVPEXP) > 0 ) { .@a = callfunc("F_Rand",.@i1,.@i2); atcommand ("@Cash " + .@a); dispbottom ("Increased Cash " + .@a ); } end; } Quote Link to comment Share on other sites More sharing options...
0 Erebos Posted January 28, 2019 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 65 Reputation: 4 Joined: 10/25/18 Last Seen: Friday at 01:38 AM Author Share Posted January 28, 2019 i used rand(10,20) instead of the function, do u think it could have any bugs like that or its fine? Quote Link to comment Share on other sites More sharing options...
0 utofaery Posted January 31, 2019 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 228 Reputation: 19 Joined: 10/27/12 Last Seen: March 17, 2019 Share Posted January 31, 2019 On 1/29/2019 at 4:15 AM, Brizyous said: i used rand(10,20) instead of the function, do u think it could have any bugs like that or its fine? Replace the line from : - script cashmvp -1,{ OnNPCKillEvent: if ( getmonsterinfo( killedrid , MOB_MVPEXP) > 0 ) { .@a = rand(10,20); atcommand ("@Cash " + .@a); dispbottom ("Increased Cash " + .@a ); } end; } Quote Link to comment Share on other sites More sharing options...
Question
Erebos
- script cashmvp -1,{ OnInit: .randcash == rand(10,20); OnNPCKillEvent: if( getmonsterinfo( killedrid,MOB_MVPEXP )){ atcommand "@cash" .randcash; dispbotton .randcash; end; } }
Can't make it work, its supposed to give a random amount of cash, between 10 and 20 every time a player kils an MVP monster. And show a message of how much cash the player got.
Link to comment
Share on other sites
5 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.