• 0
Sign in to follow this  
Rivers

Having issues with OnDay:

Question

I'm trying to get this script to only work/appear on Wednesdays. Can someone please help me out with the OnDay: command?

 

//============================================================ 
// Entrance NPCs
//============================================================
OnDayWed:

prontera,164,167,2    script

Edited by Rivers

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

you dont use commands outside a script.. you use it like this

-	script	control	-1,{

OnMon1246:
	enablenpc "npc";
end;

OnMon1247:
	disablenpc "npc";
end;

}

prontera,153,181,4	script	npc	94,{

npctalk "Hello There";
end;

OnInit:
disablenpc strnpcinfo(0);
end;

}

but i prefer to use the command gettime() for days which is much more flexible since OnDay command only works at the given time..
Sample:
 

prontera,153,181,4	script	npc	94,{

npctalk "Hello There";
end;

}

-	script	control	-1,{

OnInit:
OnHour00:
if(gettime(DT_DAYOFWEEK)==MONDAY)
	enablenpc "npc";
else
	disablenpc "npc";
end;

}

As you can see here. whenever the server/script loads again. it will check if the npc should show or hide.. not like the OnDay, it only triggers on certain time.

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

Oh thank you very much. I'm new to this all still ^^' I will run this and see how it goes.


prontera,164,167,2	script	Bossnia Staff#1	10006,{

	mes "[Riss]";
	mes "Hello?";
	mes "I found some beautiful places";
	mes "while I travelled all over the world.";
	mes "I am an adventurer.";
	mes "Haha~";
	next;
	mes "[Riss]";
	mes "What? My name is...";
	mes "'Bossnia Staff'?? No no...";
	mes "Well, my name is not so important.";
	mes "Sometimes you should be generous.";
	mes "No time for considering that kind of small stuff";
	mes "when you have to concentrate on more important things.";
	next;
	mes "[Riss]";
	mes "Hum... anyway I want to say... something..";
	mes "While I was travelling through some places,";
	mes "I found a really fearful place.";
	next;
	mes "[Riss]";
	mes "Most of the time when you come to a place,";
	mes "there is one strong and fearful monster.";
	mes "Isn't it?";
	next;
	mes "[Riss]";
	mes "But... but... in there...";
	mes "There are lots of fearful and strong monsters in there...";
	mes "That was really frightful.";
	next;
	mes "[Riss]";
	mes "If I had reacted a bit later... a few seconds...";
	mes "I might have been killed.";
	next;
	mes "[Riss]";
	mes "What?";
	mes "You want to go in there?";
	mes "Oh~ Boy~ you didn't get me.";
	mes "In there.......";
	next;
	mes "[Riss]";
	mes "Uh... you already know?";
	mes "Although you know the place, you want to go in...";
	mes "Good, I will send you there.";
	mes "But after you went there, don't hold";

	// If the VIP system is enabled, players pay a Reset Stone for 5 entrances (with a choice of warps).
	// If it's disabled, players pay 5,000z per entrance.
	if (VIP_SCRIPT) {
		mes "a grudge against me. It'll cost you 1 Reset Stone for 5 access.";
		next;
		mes "[Riss]";
		if (bossnia_event > 0) {
			set [email protected],1;
			mes "Remaining access: "+bossnia_event;
		} else if (countitem(6320)) {
			set [email protected],2;
			mes "Do you want to go?";
		} else {
			mes "You don't have a ticket now.....";
			mes "So come to me again with a Reset Stone later.";
			close;
		}
		next;
		if(select("Enter:Leave") == 2)
			close;
		set [email protected], select("First:Second:Third:Fourth");
		switch(select("Warp 1:Warp 2:Warp 3:Warp 4")) {
			case 1: set [email protected],31; set [email protected],208; break;
			case 2: set [email protected],31; set [email protected],31; break;
			case 3: set [email protected],208; set [email protected],31; break;
			case 4: set [email protected],208; set [email protected],208; break;
		}
		if ([email protected] == 1)
			set bossnia_event, bossnia_event-1;
		else {
			delitem 6320,1; //Premium_Reset_Stone
			set bossnia_event,4;
		}
		specialeffect2 EF_MAXPOWER;
		warp "bossnia_0"[email protected],[email protected],[email protected];
		close;
	} else {
		mes "a grudge against me. Also it costs 5,000 zeny.";
		next;
		if (Zeny > 4999) {
			mes "[Riss]";
			mes "Would you really like to take the challenge?";
			mes "Ok, just choose the course.";
			next;
			set [email protected], select("First:Second:Third:Fourth");
			mes "[Riss]";
			mes "Take care, boy~";
			mes "Don't hold a grudge against me.";
			close2;
			set Zeny, Zeny - 5000;
			warp "bossnia_0"[email protected],rand(202,204),rand(202,204);
			end;
		} else {
			mes "[Riss]";
			mes "You don't have enough money...";
			mes "Come back when you have at least 5,000 zeny.";
			close;
		}

	}
}
-	script	control	-1,{

OnInit:
OnHour12:
if(gettime(DT_DAYOFWEEK)==WEDNESDAY)
	enablenpc "npc";
else
	disablenpc "npc";
end;

}

So this is the script I've got, it's a basic Bossnia script. I'm trying to get it to appear only on Wednesdays at 1200 hour and disappear 12 hours later until the next Wednesday. When I put the timer command it either doesn't let me click the NPC or it just doesn't do anything. I think I might be putting it in the wrong place.

 

EDIT: I have resolved the issue. Appears I just forgot to change "npc" in the lines. Thanks for the help!

Edited by Rivers

Share this post


Link to post
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.

Loading...
Sign in to follow this