Jump to content
  • 0

BET


Rage Guy

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

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

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


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;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

error pls help

ssssssssss.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


prontera,150,150,0<TAB>script<TAB>Gambler<TAB>100,{

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

when i click yes or no he just stun me

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...