Jump to content
  • 0

Problem with my script


angelwarrior

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   0
  • Joined:  02/21/16
  • Last Seen:  

Hi guys i have a script that is not working okay. Yesterday it worked fine, but  today when i kill monster, the warp dissapear pass 10 seconds or sometimes 3 seconds.

pvp_n_1-3,83,116,5	script	PoringSpawner1	139,{
	end;
	
OnNPCKillEvent:
if (killedrid == 1296) { 
     getmapxy(.@mapa$,.@x,.@y,0);
     if (.@mapa$ == "pvp_n_1-3") {
	enablenpc "PoringWarp1";
	sleep 120000;
	disablenpc "PoringWarp1";
	end;
	}
}
//Disable the warp when the server starts.
OnInit:
	disablenpc "PoringWarp1";
	end;
}

//My Example

//Warp NPC
pvp_n_1-3,100,140,0	warp	PoringWarp1	1,1,aldebaran,143,57


Edited by angelwarrior
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


pvp_n_1-3,83,116,5 script PoringSpawner1 139,{

end;

OnNPCKillEvent:

if (killedrid == 1296) {

/*

- if player kill several monsters in few seconds, spam of enable/disable

Set a variable when timer start then clear when end

*/

getmapxy(.@mapa$,.@x,.@y,0);

if (.@mapa$ == "pvp_n_1-3") {

enablenpc "PoringWarp1";

sleep 120000;

disablenpc "PoringWarp1";

end;

}

}

// <- add end to stop the script here otherwise if players kill another monster than 1296 or 1296 on another map than pvp_n_1-3, the warp is disabled

//Disable the warp when the server starts.

OnInit:

disablenpc "PoringWarp1";

end;

}

//My Example

//Warp NPC

pvp_n_1-3,100,140,0 warp PoringWarp1 1,1,aldebaran,143,57

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   0
  • Joined:  02/21/16
  • Last Seen:  

pvp_n_1-3,83,116,5	script	PoringSpawner1	139,{
	end;
	
OnNPCKillEvent:
	if (killedrid == 1296) {
		/*
		- if player kill several monsters in few seconds, spam of enable/disable
			Set a variable when timer start then clear when end
		*/
		getmapxy(.@mapa$,.@x,.@y,0);
		if (.@mapa$ == "pvp_n_1-3") {
			enablenpc "PoringWarp1";
			sleep 120000;
			disablenpc "PoringWarp1";
			end;
		}
	}
	// <- add end to stop the script here otherwise if players kill another monster than 1296 or 1296 on another map than pvp_n_1-3, the warp is disabled

//Disable the warp when the server starts.
OnInit:
	disablenpc "PoringWarp1";
	end;
}

//My Example

//Warp NPC
pvp_n_1-3,100,140,0	warp	PoringWarp1	1,1,aldebaran,143,57

can you help me yo put variable there?  how i can put it? set variablewarp, 1; then?

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Something like

		if (.@mapa$ == "pvp_n_1-3" && .enabled == 0) {
			enablenpc "PoringWarp1";
			.enabled = 1;
			sleep 120000;
			.enabled = 0;
			disablenpc "PoringWarp1";
			end;
		}
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

OnNPCKillEvent:
if (killedrid == 1296) { 
     getmapxy(.@mapa$,.@x,.@y,0);
     if (.@mapa$ == "pvp_n_1-3") {
	enablenpc "PoringWarp1";
	sleep 120000;
	disablenpc "PoringWarp1";
	end;
	}
}

I think because of this 

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