Rage Guy Posted July 20, 2013 Posted July 20, 2013 i want a bet npc the npc is i want the person when he talk to the npc the npc ask him first yes or no for betting the betting is only for 40m Zeny 70% lose them 30% be 80m Zemy Quote
Patskie Posted July 20, 2013 Posted July 20, 2013 prontera,150,150,0 script Gambler 100,{ set .@npc$,"[ " +strnpcinfo(1)+ " ]"; set .@chance,30; // 30% chance set .@zeny,40000000; mes .@npc$; mes "Bet with me " +strcharinfo(0); if ( select("Yes:No") - 1 || Zeny < .@zeny ) end; if ( rand(100) < .@chance ) set Zeny, Zeny + ( .@zeny * 2 ); else set Zeny, Zeny - .@zeny; } Quote
Patskie Posted July 20, 2013 Posted July 20, 2013 prontera,150,150,0<TAB>script<TAB>Gambler<TAB>100,{ Quote
Rage Guy Posted July 23, 2013 Author Posted July 23, 2013 when i click yes or no he just stun me Quote
DeadlySilence Posted July 23, 2013 Posted July 23, 2013 Try this: prontera,150,150,0 script Gambler 100,{ set .@npc$," [ " +strnpcinfo(1)+ " ]"; set .@chance, 30; // 30% chance set .@zeny, 40000000; mes .@npc$; mes "Bet with me, " + strcharinfo(0) + "!"; if (2 == select("Yes:No")) { next; mes .@npc$; mes "Okay, maybe next time."; close; } if (.@zeny > Zeny) { next; mes .@npc$; mes "I'm sorry, but you don't have enough Zeny. You need " + .@zeny + " to bet."; close; } next; if (rand(100) < .@chance) { mes .@npc$; mes "Hooray, you won!"; set Zeny, Zeny + ( .@zeny * 2 ); close; } else { mes .@npc$; mes "Too bad, you lost!"; set Zeny, Zeny - .@zeny; close; } } The same as Patskie's, but with more detailed output for the user. Quote
Question
Rage Guy
i want a bet npc
the npc is
i want the person when he talk to the npc
the npc ask him first yes or no for betting
the betting is
only for 40m Zeny
70% lose them
30% be 80m Zemy
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.