Jump to content
  • 0

Making script once per Account.


Battousai88

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  01/15/18
  • Last Seen:  

Hello Guys,

I have some issues making this Script playable once per Account. It would be really nice if someone could help me with that.

Here is the Script:

prontera,150,150,5	script	Sample	508,{
	if (H_L_E != gettime(8)) {
		set H_L_T, 0;
	}
	L_Intro:
	set .@name$, "[Sample]";
	mes .@name$;
	mes "Hi, would you like to play the game?";
	mes "It costs 100,000 Zeny and you may only play 1 round a day.";
	menu "Yes!", -, "Explain the rules", L_Rules;

	next;
	if (H_L_T >= 1) {
		mes .@name$;
		mes "You've already played 1 round today.";
		mes "Please come back tomorrow.";
		close;
	}
	if (Zeny < 100000) {
		mes .@name$;
		mes "Not enough Zeny!";
		close;
	}
	set Zeny, Zeny - 100000;
	set H_L_T, H_L_T + 1;
	set H_L_E, gettime(8);
	L_Start:
	set .@mynumber, rand(2,9);
	set .@npcnumber, rand(1,10);
	while (.@npcnumber == .@mynumber) {
		set .@npcnumber, rand(1,10);
	}
	mes .@name$;
	mes "Your number is ^0000FF"+.@mynumber+"^000000";
	mes "Is my number higher or lower than yours?";
	set .@choice, select("Higher:Lower");
	next;
	switch(.@choice) {
		case 1:
			if (.@npcnumber > .@mynumber)
				set .@correct, 1;
			else
				set .@correct, 0;
			break;
		
		case 2:
			if (.@npcnumber > .@mynumber)
				set .@correct, 0;
			else
				set .@correct, 1;
			break;
	}
	mes .@name$;
	if (.@correct) {
		set .@wins, .@wins + 1;
		if (.@wins >= 5) {
			mes "You guessed correctly!";
			mes "You have 5 wins, which means you won the game!";
			next;
			mes .@name$;
			mes "Here is your prize. Enjoy!";
			getitem .prize_id, .prize_amount;
			close;
		}
		mes "You guessed correctly!";
		mes "You have now ^FF0000"+.@wins+"^000000 "+((.@wins > 1)? "wins":"win")+".";
		mes (5-.@wins)+" more "+(((5-.@wins) > 1)? "wins":"win")+" to get a prize!";
		next;
		goto L_Start;
	}
	else {
		mes "You guessed incorrectly!";
		mes "Try again next time!";
		close; 
	}
	


	L_Rules:
	next;
	mes .@name$;
	mes "Ok, I will initially give you a number between 1 and 10.";
	mes "Then I will give myself a number between 1 and 10 (hidden).";
	mes "You must guess whether my number is higher or lower than yours.";
	mes "In order to win the ^00FF00Poring Coin^000000 you must win 5 times in a row.";
	next;
	goto L_intro;

	OnInit:
	set .prize_id, 7539;
	set .prize_amount, 1;
	end;
}

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  333
  • Reputation:   67
  • Joined:  09/05/12
  • Last Seen:  

9 minutes ago, Battousai88 said:

Hello Guys,

I have some issues making this Script playable once per Account. It would be really nice if someone could help me with that.

Here is the Script:


prontera,150,150,5	script	Sample	508,{
	if (H_L_E != gettime(8)) {
		set H_L_T, 0;
	}
	L_Intro:
	set .@name$, "[Sample]";
	mes .@name$;
	mes "Hi, would you like to play the game?";
	mes "It costs 100,000 Zeny and you may only play 1 round a day.";
	menu "Yes!", -, "Explain the rules", L_Rules;

	next;
	if (H_L_T >= 1) {
		mes .@name$;
		mes "You've already played 1 round today.";
		mes "Please come back tomorrow.";
		close;
	}
	if (Zeny < 100000) {
		mes .@name$;
		mes "Not enough Zeny!";
		close;
	}
	set Zeny, Zeny - 100000;
	set H_L_T, H_L_T + 1;
	set H_L_E, gettime(8);
	L_Start:
	set .@mynumber, rand(2,9);
	set .@npcnumber, rand(1,10);
	while (.@npcnumber == .@mynumber) {
		set .@npcnumber, rand(1,10);
	}
	mes .@name$;
	mes "Your number is ^0000FF"+.@mynumber+"^000000";
	mes "Is my number higher or lower than yours?";
	set .@choice, select("Higher:Lower");
	next;
	switch(.@choice) {
		case 1:
			if (.@npcnumber > .@mynumber)
				set .@correct, 1;
			else
				set .@correct, 0;
			break;
		
		case 2:
			if (.@npcnumber > .@mynumber)
				set .@correct, 0;
			else
				set .@correct, 1;
			break;
	}
	mes .@name$;
	if (.@correct) {
		set .@wins, .@wins + 1;
		if (.@wins >= 5) {
			mes "You guessed correctly!";
			mes "You have 5 wins, which means you won the game!";
			next;
			mes .@name$;
			mes "Here is your prize. Enjoy!";
			getitem .prize_id, .prize_amount;
			close;
		}
		mes "You guessed correctly!";
		mes "You have now ^FF0000"+.@wins+"^000000 "+((.@wins > 1)? "wins":"win")+".";
		mes (5-.@wins)+" more "+(((5-.@wins) > 1)? "wins":"win")+" to get a prize!";
		next;
		goto L_Start;
	}
	else {
		mes "You guessed incorrectly!";
		mes "Try again next time!";
		close; 
	}
	


	L_Rules:
	next;
	mes .@name$;
	mes "Ok, I will initially give you a number between 1 and 10.";
	mes "Then I will give myself a number between 1 and 10 (hidden).";
	mes "You must guess whether my number is higher or lower than yours.";
	mes "In order to win the ^00FF00Poring Coin^000000 you must win 5 times in a row.";
	next;
	goto L_intro;

	OnInit:
	set .prize_id, 7539;
	set .prize_amount, 1;
	end;
}

 

Change all your H_L_E and H_L_T variable into #H_L_E and #H_L_T
Then that variables holds the data for the whole account.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  01/15/18
  • Last Seen:  

Oh nice, thank you! That solved my issue. ^^

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  333
  • Reputation:   67
  • Joined:  09/05/12
  • Last Seen:  

26 minutes ago, Battousai88 said:

Oh nice, thank you! That solved my issue. ^^

No problem, Glad I helped you in your problem ;)

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...