Jump to content
  • 0

Hideon and off NPC script


ajaytrix

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

Hi rAthena, regarding the hidenpc script. Is my script fine? I've tried it and it has no errors. But the thing is, I wanted the NPCs to hide and return to the said specific day and time throughout the whole server. The NPC is not hiding every wednesday and so on, hope someone can help me. 


-	script	HidingNPC	-1,{
OnInit:

//Hides NPC on Wed
OnWed2359:
	hideonnpc "Kellvahni#gefg_cas04"; //gefg_cas04 72 46
	sleep ( 5 * 60000 );

OnTue0000:
	hideoffnpc "Kellvahni#gefg_cas04";
	end;
	
//Hides on Saturday
OnSat2359:
	hideonnpc "Roy#prtg_cas02"; //prtg_cas02 94 61
	sleep ( 5 * 60000 );

OnThu2300:
	hideoffnpc "Roy#prtg_cas02";
	end;
//Hides Hides on sunday 
OnSun2358:
	hideonnpc "Nahzarf#aldeg_cas03"; //aldeg_cas03 110 118
	sleep ( 5 * 60000 );

OnSun0000:
	hideoffnpc "Nahzarf#aldeg_cas03";
	end;
	

	
}

 

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

48 minutes ago, ajaytrix said:

Technically, if i @reloadscript, all the NPCs are showing, I would still wait for the time then??? :( Is there any other ways to hide them instantly before waiting for the scripts to work?

-	script	HidingNPC	-1,{
OnInit:
	hideonnpc "Kellvahni#gefg_cas04";
	hideonnpc "Roy#prtg_cas02";
	hideonnpc "Nahzarf#aldeg_cas03";
	end;

//Hides NPC on Wed
OnWed2359:
	hideonnpc "Kellvahni#gefg_cas04"; //gefg_cas04 72 46
	end;

OnTue0000:
	hideoffnpc "Kellvahni#gefg_cas04";
	end;
	
//Hides on Saturday
OnSat2359:
	hideonnpc "Roy#prtg_cas02"; //prtg_cas02 94 61
	end;

OnThu2300:
	hideoffnpc "Roy#prtg_cas02";
	end;

//Hides Hides on sunday 
OnSun2358:
	hideonnpc "Nahzarf#aldeg_cas03"; //aldeg_cas03 110 118
	end;

OnSun0000:
	hideoffnpc "Nahzarf#aldeg_cas03";
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

Hi rAthena, regarding the hidenpc script. Is my script fine? I've tried it and it has no errors. But the thing is, I wanted the NPCs to hide and return to the said specific day and time throughout the whole server. The NPC is not hiding every wednesday and so on, hope someone can help me. 


-	script	HidingNPC	-1,{
OnInit:

//Hides NPC on Wed
OnWed2359:
	hideonnpc "Kellvahni#gefg_cas04"; //gefg_cas04 72 46
	sleep ( 5 * 60000 );

OnTue0000:
	hideoffnpc "Kellvahni#gefg_cas04";
	end;
	
//Hides on Saturday
OnSat2359:
	hideonnpc "Roy#prtg_cas02"; //prtg_cas02 94 61
	sleep ( 5 * 60000 );

OnThu2300:
	hideoffnpc "Roy#prtg_cas02";
	end;
//Hides Hides on sunday 
OnSun2358:
	hideonnpc "Nahzarf#aldeg_cas03"; //aldeg_cas03 110 118
	sleep ( 5 * 60000 );

OnSun0000:
	hideoffnpc "Nahzarf#aldeg_cas03";
	end;
	

	
}
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

I think you don't need to put OnInit since OnWed2359 is also a executable label.

Btw what's the sleep for?

Your script will trigger the hideoffnpc after 5 minutes since it has no 'end'.

Anyways try this if it will work

-	script	HidingNPC	-1,{
//OnInit:

//Hides NPC on Wed
OnWed2359:
	hideonnpc "Kellvahni#gefg_cas04"; //gefg_cas04 72 46
	// sleep ( 5 * 60000 );
	end;

OnTue0000:
	hideoffnpc "Kellvahni#gefg_cas04";
	end;
	
//Hides on Saturday
OnSat2359:
	hideonnpc "Roy#prtg_cas02"; //prtg_cas02 94 61
	//sleep ( 5 * 60000 );
	end;

OnThu2300:
	hideoffnpc "Roy#prtg_cas02";
	end;

//Hides Hides on sunday 
OnSun2358:
	hideonnpc "Nahzarf#aldeg_cas03"; //aldeg_cas03 110 118
	//sleep ( 5 * 60000 );
	end;

OnSun0000:
	hideoffnpc "Nahzarf#aldeg_cas03";
	end;
}

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

3 hours ago, Technoken said:

I think you don't need to put OnInit since OnWed2359 is also a executable label.

Btw what's the sleep for?

Your script will trigger the hideoffnpc after 5 minutes since it has no 'end'.

Anyways try this if it will work


-	script	HidingNPC	-1,{
//OnInit:

//Hides NPC on Wed
OnWed2359:
	hideonnpc "Kellvahni#gefg_cas04"; //gefg_cas04 72 46
	// sleep ( 5 * 60000 );
	end;

OnTue0000:
	hideoffnpc "Kellvahni#gefg_cas04";
	end;
	
//Hides on Saturday
OnSat2359:
	hideonnpc "Roy#prtg_cas02"; //prtg_cas02 94 61
	//sleep ( 5 * 60000 );
	end;

OnThu2300:
	hideoffnpc "Roy#prtg_cas02";
	end;

//Hides Hides on sunday 
OnSun2358:
	hideonnpc "Nahzarf#aldeg_cas03"; //aldeg_cas03 110 118
	//sleep ( 5 * 60000 );
	end;

OnSun0000:
	hideoffnpc "Nahzarf#aldeg_cas03";
	end;
}

 

 

Hi, this script will work continuously right, not just on a certain week?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

17 minutes ago, ajaytrix said:

Hi, this script will work continuously right, not just on a certain week?

What do you mean by continuously? Like every week? It will be triggered Every Tuesday, Wednesday, Thursday, Saturday, and Sunday.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

5 hours ago, Technoken said:

What do you mean by continuously? Like every week? It will be triggered Every Tuesday, Wednesday, Thursday, Saturday, and Sunday.

Yes, for all the tuesday, wed, thursday, sat, and sunday. Will it triggered all the time of the year?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

13 hours ago, ajaytrix said:

Yes, for all the tuesday, wed, thursday, sat, and sunday. Will it triggered all the time of the year?

Yes

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  03/29/12
  • Last Seen:  

On 2/11/2017 at 11:30 AM, Technoken said:

Yes

Technically, if i @reloadscript, all the NPCs are showing, I would still wait for the time then??? :( Is there any other ways to hide them instantly before waiting for the scripts to work?

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

list out which npc should hide on which day, and unhide on which day.

 

based on your first script above, your method is wrong with the sleep usage upon triggered the hideonnpc script command, because it continue to run the script after the paused time.

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