Mizore Posted May 10, 2020 Posted May 10, 2020 Hi people~ I'm looking for a script that after a player A kill another player B on a specific map, A have a chance on getting a item or cash. Anyone knows a command to do that? Thanks ~ Quote
0 Mabuhay Posted May 10, 2020 Posted May 10, 2020 (edited) - script asdahjhla -1,{ OnPCKillEvent: if ( inarray(.map$, strcharinfo(3)) != -1 ) { if ( rand(100) <= .chance ) { getitem 501, 10; #CASHPOINTS += 1; // I forgot to add this dispbottom "You earned 1 Cash Point. Total : "+ #CASHPOINTS; } } end; OnInit: .chance = 50; // chance to get something setarray .map$, "prontera", "payon"; // map list } Edited May 10, 2020 by Mabuhay 1 Quote
0 Patskie Posted May 11, 2020 Posted May 11, 2020 9 hours ago, Mabuhay said: - script asdahjhla -1,{ OnPCKillEvent: if ( inarray(.map$, strcharinfo(3)) != -1 ) { if ( rand(100) <= .chance ) { getitem 501, 10; #CASHPOINTS += 1; // I forgot to add this dispbottom "You earned 1 Cash Point. Total : "+ #CASHPOINTS; } } end; OnInit: .chance = 50; // chance to get something setarray .map$, "prontera", "payon"; // map list } This can be exploited if you do a suicide mission (paladin casting grand cross for instance) @Mizore Change if ( rand(100) <= .chance ) { to if ( rand(100) <= .chance && killedrid != getcharid(3) ) { 1 Quote
0 Mizore Posted May 11, 2020 Author Posted May 11, 2020 55 minutes ago, Patskie said: This can be exploited if you do a suicide mission (paladin casting grand cross for instance) @Mizore Change if ( rand(100) <= .chance ) { to if ( rand(100) <= .chance && killedrid != getcharid(3) ) { Yeah that's great. Thank you guys. I have another question. I wanna add to this script a chance to drop a costume at 0.1% of chance. My question is: Can I use the variable value .chance = 0.1;? Thanks again Quote
Question
Mizore
Hi people~
I'm looking for a script that after a player A kill another player B on a specific map, A have a chance on getting a item or cash.
Anyone knows a command to do that?
Thanks ~
4 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.