Erebos Posted January 28, 2019 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 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: [email protected] = killedrid; //dispbottom (" killedrid :: " + killedrid ); if ( getmonsterinfo( [email protected] , MOB_MVPEXP) > 0 ) { [email protected] = callfunc("F_Rand",100,200); atcommand ("@Cash " + [email protected]); dispbottom ("Increased Cash " + [email protected] ); } 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 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 Share Posted January 28, 2019 my bad change 100 and 200 to anything. - script cashmvp -1,{ OnNPCKillEvent: [email protected] = 100; [email protected] = 200; if ( getmonsterinfo( killedrid , MOB_MVPEXP) > 0 ) { [email protected] = callfunc("F_Rand",[email protected],[email protected]); atcommand ("@Cash " + [email protected]); dispbottom ("Increased Cash " + [email protected] ); } end; } Quote Link to comment Share on other sites More sharing options...
0 Erebos Posted January 28, 2019 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 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 ) { [email protected] = rand(10,20); atcommand ("@Cash " + [email protected]); dispbottom ("Increased Cash " + [email protected] ); } end; } Quote Link to comment Share on other sites More sharing options...
- 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