Last Man Standing Map Crash HELP

nasagnilac

New member
Messages
121
Points
0
Github
gmblank
I made an LMS Script and I got this error

[ Error ] : over 65k instances of 'LMS_NPC' script are being run

I doubt that this is the cause of the server map crash.
I hope someone can help me fixed this.
 

Code:
-	script	Clock_Time	FAKE_NPC,{
OnClock0230:
OnClock0930:
OnClock1430:
OnClock2130:
donpcevent "LMS_NPC::OnStart";
end;
}

-	script	LMS_NPC	FAKE_NPC,{

OnStart:
			set $lms,1;
			setnpctimer 0;
			announce "[Event] The Last Man Standing event will be starting shortly.",16;
			sleep2 10000;
			announce "[Event] Those who want to play, please type @joinevent.",16;
			sleep2 10000;
			announce "[Event] After 1 Minute the registration will close.",16;
			sleep2 10000;
			announce "[Event] Please type @joinevent now if you want to join.",16;
			initnpctimer;
			end;

	OnTimer30000:
			announce "[Event] Last 30 seconds.",16;
			sleep2 5000;
			announce "[Event] If you want to join please type @joinevent.",16;
			end;
	
	OnTimer50000:
			announce "[Event] Last 10 seconds.",16;
			end;
	
	OnTimer55000:
			announce "[Event] 5!",16;
			end;
	
	OnTimer56000:
			announce "[Event] 4!",16;
			end;
	
	OnTimer57000:
			announce "[Event] 3!",16;
			end;
	
	OnTimer58000:
			announce "[Event] 2!",16;
			end;
	
	OnTimer59000:
			announce "[Event] 1!",16;
			end;
	
	OnTimer60000:
			announce "[Event] Time's up.",16;
			end;
	
	OnTimer61000:
			set $lms,0;
			donpcevent "LMS_NPC::OnEnable";
			stopnpctimer;
			end;


OnDoStart:
	if (compare(.@atcmd_parameters$, "on")) {
		if($lms){
			dispbottom "Last Man Standing Event is still active.";
			end;
		}
		callsub OnStart;
	}
end;

OnDoPrize:
	if (strcharinfo(3) == .map$ && getmapusers(.map$) == 1 && $lms == 0) {
			announce "Congratulations "+strcharinfo(0)+", our Last Man Standing winner!.",16;
			getitem 32005,3;
			atcommand "@cash 10";
			warp "SavePoint",0,0;
	}
end;

OnEnable:
			sleep2 5000;
			mapannounce .map$,"[Event] We are about to start the Last Man Standing event.",16;
			sleep2 10000;
			mapannounce .map$,"[Event] But before we start the event here's how to play the game...",16;
			sleep2 10000;
			mapannounce .map$,"[Event] This is a survival game where you need to eliminate all players inside this map.",16;
			sleep2 10000;
			mapannounce .map$,"[Event] Everytime you killed a player, you will receive 1 Yggdrasil Berry.",16;
			sleep2 10000;
			mapannounce .map$,"[Event] Be the last man who stand and be rewarded.",16;
			sleep2 10000;
			mapannounce .map$,"[Event] Okay let's start the game!",16;
			sleep2 5000;
			mapannounce .map$,"[Event] 5!",16;
			sleep2 1000;
			mapannounce .map$,"[Event] 4!",16;
			sleep2 1000;
			mapannounce .map$,"[Event] 3!",16;
			sleep2 1000;
			mapannounce .map$,"[Event] 2!",16;
			sleep2 1000;
			mapannounce .map$,"[Event] 1!",16;
			sleep2 1000;
			mapannounce .map$,"[Event] GO!",16;
			sleep2 1000;
			set .status,1;
			pvpon .map$;
			donpcevent "LMS_NPC::OnCheck"; 
			end;
			
OnCheck:
	while(.status){
		sleep2 10000;
		if(getmapusers(.map$) == 1){
			goto L_Winner;
		}else if(getmapusers(.map$) == 2){
			goto L_Remain;
			
		}else if(getmapusers(.map$) == 0){
			goto L_None;
		}else{
			donpcevent "LMS_NPC::OnCheck"; 
		}
	}
end;
	
L_Winner:
	pvpoff .map$;
	mapannounce .map$,"[Event] Please type ' @lmsprize ' for your rewards.",16;
	set .status,0;
end;

L_None:
	pvpoff .map$;
	set .status,0;
	announce "[Event] We don't have any winner on our Last Man Standing event. See you next time..",16;
end;	

L_Remain:
	sleep2 10000;
	mapannounce .map$,"[Event] Last 2 Brave warriors are still alive!",16;
	sleep2 10000;
	mapannounce .map$,"[Event] You can use @showplayer to detect players who use hide, chase walk or even cloaking skill for 2 minutes.",16;
	donpcevent "LMS_NPC::OnCheck"; 
end;
	
OnInit:

	bindatcmd "lms","LMS_NPC::OnDoStart",80,100;
	bindatcmd "lmsprize","LMS_NPC::OnDoPrize",0,100;
	bindatcmd "showplayer","LMS_NPC::OnDoShow",0,100;
	set .status,0;
	set .map$,"1@lhz";
	set .mapx,138;
	set .mapy,134;
	set $lms,0;	
	set .cdtime,5;
end;

OnDoShow:
		getmapxy(.@map$,.@x,.@y,0);
		if(.@map$ != .map$ && getmapusers(.map$) >= 2 && .status < 1){end;}
		set .@time,gettimetick(2);
		set .@cd,(60*.cdtime);
		if(.@time - #showplayer < .@cd) {
				set .@k,#showplayer - (gettimetick(2)-.@cd);
				set .@m,.@k % 3600 / 60;
				set .@s,.@k % 60;
				set .@m$, .@m+" minute"+((.@m <= 1)?"":"s");
				set .@s$, .@s+" second"+((.@s <= 1)?"":"s");
				set .@time$,""+.@m$+" "+.@s$+"";
				dispbottom ""+.@time$+" left before you can use it again.";
				end;
		}
		set #showplayer,gettimetick(2);
	sc_start SC_CLAIRVOYANCE,120000,0;
end;
}

// -- -- -- Kills Configurations -- -- -- // 

-	script	Kills_Con	FAKE_NPC,{

OnStart:
	setnpctimer 0;
    initnpctimer;
    end; 
	
OnTimer1000:
    mapannounce getvariableofnpc(.map$,"LMS_NPC"),"You have only 7 minutes to eliminate all opponents.",16;
    end;
	
OnTimer240000:
    mapannounce getvariableofnpc(.map$,"LMS_NPC"),"3 minutes left.",16;
    end;

OnTimer360000:
    mapannounce getvariableofnpc(.map$,"LMS_NPC"),"1 minute left.",16;
    end;
	
OnTimer390000:
    mapannounce getvariableofnpc(.map$,"LMS_NPC"),"30 seconds left.",16;
    end;
	
OnTimer410000:
    mapannounce getvariableofnpc(.map$,"LMS_NPC"),"10 seconds left.",16;
    end;
	
OnTimer415000:
    mapannounce getvariableofnpc(.map$,"LMS_NPC"),"5 seconds left.",16;
    end;
	
OnTimer420000:
	donpcevent "LMS_NPC::L_None";
    end;
	
OnTimer425000:
	mapwarp getvariableofnpc(.map$,"LMS_NPC"),"prontera",116,73,0;
	donpcevent "L_None::OnCheck"; 
	stopnpctimer;
    end;
	
	
OnPCDieEvent:
	getmapxy(.@map$,.@x,.@y,0);
	if(.@map$==getvariableofnpc(.map$,"LMS_NPC")){
		set #kill_point, 0;
		mapannounce getvariableofnpc(.map$,"LMS_NPC"),""+strcharinfo(0)+" died, and out of the game!.",16;
		sleep2 1000;
		warp "SavePoint",0,0;
		end;
	}
	
OnPCKillEvent:
	getmapxy(.@map$,.@x,.@y,0);
	if(.@map$==getvariableofnpc(.map$,"LMS_NPC")){
		set #kill_point,#kill_point+1;
		if ( #kill_point % 1 == 0) {
			getitembound 607,1,1;
			end;
		}
	}
}

// -- -- -- Mapflags -- -- -- // 
1@lhz	mapflag	nowarp
1@lhz	mapflag	nowarpto
1@lhz	mapflag	noteleport
1@lhz	mapflag	nosave
1@lhz	mapflag	nomemo
1@lhz	mapflag	nobranch
1@lhz	mapflag	pvp_noparty
1@lhz	mapflag	pvp_noguild
1@lhz	mapflag	noreturn
1@lhz	mapflag	zone	Last Man Standing
 
maybe you just have to change the map or make a dup of it with different name?

probably issue come from another instance script.

 
That script isn't an instance script though. From what I can tell it's just an event that happens on a map. Instances duplicate the original map, so maybe the events are being triggered from another instance only if an instance exists on that map, if not then I don't know, I'll load your script and see what's wrong.

 
I made an LMS Script and I got this error

[ Error ] : over 65k instances of 'LMS_NPC' script are being run

I doubt that this is the cause of the server map crash.

I hope someone can help me fixed this.

- script Clock_Time FAKE_NPC,{
OnClock0230:
OnClock0930:
OnClock1430:
OnClock2130:
donpcevent "LMS_NPC::OnStart";
end;
}

- script LMS_NPC FAKE_NPC,{

OnStart:
set $lms,1;
setnpctimer 0;
announce "[Event] The Last Man Standing event will be starting shortly.",16;
sleep2 10000;
announce "[Event] Those who want to play, please type @joinevent.",16;
sleep2 10000;
announce "[Event] After 1 Minute the registration will close.",16;
sleep2 10000;
announce "[Event] Please type @joinevent now if you want to join.",16;
initnpctimer;
end;

OnTimer30000:
announce "[Event] Last 30 seconds.",16;
sleep2 5000;
announce "[Event] If you want to join please type @joinevent.",16;
end;

OnTimer50000:
announce "[Event] Last 10 seconds.",16;
end;

OnTimer55000:
announce "[Event] 5!",16;
end;

OnTimer56000:
announce "[Event] 4!",16;
end;

OnTimer57000:
announce "[Event] 3!",16;
end;

OnTimer58000:
announce "[Event] 2!",16;
end;

OnTimer59000:
announce "[Event] 1!",16;
end;

OnTimer60000:
announce "[Event] Time's up.",16;
end;

OnTimer61000:
set $lms,0;
donpcevent "LMS_NPC::OnEnable";
stopnpctimer;
end;


OnDoStart:
if (compare(.@atcmd_parameters$, "on")) {
if($lms){
dispbottom "Last Man Standing Event is still active.";
end;
}
callsub OnStart;
}
end;

OnDoPrize:
if (strcharinfo(3) == .map$ && getmapusers(.map$) == 1 && $lms == 0) {
announce "Congratulations "+strcharinfo(0)+", our Last Man Standing winner!.",16;
getitem 32005,3;
atcommand "@cash 10";
warp "SavePoint",0,0;
}
end;

OnEnable:
sleep2 5000;
mapannounce .map$,"[Event] We are about to start the Last Man Standing event.",16;
sleep2 10000;
mapannounce .map$,"[Event] But before we start the event here's how to play the game...",16;
sleep2 10000;
mapannounce .map$,"[Event] This is a survival game where you need to eliminate all players inside this map.",16;
sleep2 10000;
mapannounce .map$,"[Event] Everytime you killed a player, you will receive 1 Yggdrasil Berry.",16;
sleep2 10000;
mapannounce .map$,"[Event] Be the last man who stand and be rewarded.",16;
sleep2 10000;
mapannounce .map$,"[Event] Okay let's start the game!",16;
sleep2 5000;
mapannounce .map$,"[Event] 5!",16;
sleep2 1000;
mapannounce .map$,"[Event] 4!",16;
sleep2 1000;
mapannounce .map$,"[Event] 3!",16;
sleep2 1000;
mapannounce .map$,"[Event] 2!",16;
sleep2 1000;
mapannounce .map$,"[Event] 1!",16;
sleep2 1000;
mapannounce .map$,"[Event] GO!",16;
sleep2 1000;
set .status,1;
pvpon .map$;
donpcevent "LMS_NPC::OnCheck";
end;

OnCheck:
while(.status){
sleep2 10000;
if(getmapusers(.map$) == 1){
goto L_Winner;
}else if(getmapusers(.map$) == 2){
goto L_Remain;

}else if(getmapusers(.map$) == 0){
goto L_None;
}else{
donpcevent "LMS_NPC::OnCheck";
}
}
end;

L_Winner:
pvpoff .map$;
mapannounce .map$,"[Event] Please type ' @lmsprize ' for your rewards.",16;
set .status,0;
end;

L_None:
pvpoff .map$;
set .status,0;
announce "[Event] We don't have any winner on our Last Man Standing event. See you next time..",16;
end;

L_Remain:
sleep2 10000;
mapannounce .map$,"[Event] Last 2 Brave warriors are still alive!",16;
sleep2 10000;
mapannounce .map$,"[Event] You can use @showplayer to detect players who use hide, chase walk or even cloaking skill for 2 minutes.",16;
donpcevent "LMS_NPC::OnCheck";
end;

OnInit:

bindatcmd "lms","LMS_NPC::OnDoStart",80,100;
bindatcmd "lmsprize","LMS_NPC::OnDoPrize",0,100;
bindatcmd "showplayer","LMS_NPC::OnDoShow",0,100;
set .status,0;
set .map$,"1@lhz";
set .mapx,138;
set .mapy,134;
set $lms,0;
set .cdtime,5;
end;

OnDoShow:
getmapxy(.@map$,.@x,.@y,0);
if(.@map$ != .map$ && getmapusers(.map$) >= 2 && .status < 1){end;}
set .@time,gettimetick(2);
set .@cd,(60*.cdtime);
if(.@time - #showplayer < .@cd) {
set .@k,#showplayer - (gettimetick(2)-.@cd);
set .@m,.@k % 3600 / 60;
set .@s,.@k % 60;
set .@m$, .@m+" minute"+((.@m <= 1)?"":"s");
set .@s$, .@s+" second"+((.@s <= 1)?"":"s");
set .@time$,""+.@m$+" "+.@s$+"";
dispbottom ""+.@time$+" left before you can use it again.";
end;
}
set #showplayer,gettimetick(2);
sc_start SC_CLAIRVOYANCE,120000,0;
end;
}

// -- -- -- Kills Configurations -- -- -- //

- script Kills_Con FAKE_NPC,{

OnStart:
setnpctimer 0;
initnpctimer;
end;

OnTimer1000:
mapannounce getvariableofnpc(.map$,"LMS_NPC"),"You have only 7 minutes to eliminate all opponents.",16;
end;

OnTimer240000:
mapannounce getvariableofnpc(.map$,"LMS_NPC"),"3 minutes left.",16;
end;

OnTimer360000:
mapannounce getvariableofnpc(.map$,"LMS_NPC"),"1 minute left.",16;
end;

OnTimer390000:
mapannounce getvariableofnpc(.map$,"LMS_NPC"),"30 seconds left.",16;
end;

OnTimer410000:
mapannounce getvariableofnpc(.map$,"LMS_NPC"),"10 seconds left.",16;
end;

OnTimer415000:
mapannounce getvariableofnpc(.map$,"LMS_NPC"),"5 seconds left.",16;
end;

OnTimer420000:
donpcevent "LMS_NPC::L_None";
end;

OnTimer425000:
mapwarp getvariableofnpc(.map$,"LMS_NPC"),"prontera",116,73,0;
donpcevent "L_None::OnCheck";
stopnpctimer;
end;


OnPCDieEvent:
getmapxy(.@map$,.@x,.@y,0);
if(.@map$==getvariableofnpc(.map$,"LMS_NPC")){
set #kill_point, 0;
mapannounce getvariableofnpc(.map$,"LMS_NPC"),""+strcharinfo(0)+" died, and out of the game!.",16;
sleep2 1000;
warp "SavePoint",0,0;
end;
}

OnPCKillEvent:
getmapxy(.@map$,.@x,.@y,0);
if(.@map$==getvariableofnpc(.map$,"LMS_NPC")){
set #kill_point,#kill_point+1;
if ( #kill_point % 1 == 0) {
getitembound 607,1,1;
end;
}
}
}

// -- -- -- Mapflags -- -- -- //
1@lhz mapflag nowarp
1@lhz mapflag nowarpto
1@lhz mapflag noteleport
1@lhz mapflag nosave
1@lhz mapflag nomemo
1@lhz mapflag nobranch
1@lhz mapflag pvp_noparty
1@lhz mapflag pvp_noguild
1@lhz mapflag noreturn
1@lhz mapflag zone Last Man Standing
Update your kRO, maybe you have outdated GRF, i had this issues before in 1@lhz, since that map is renewal, i just update my kRO then no more error

EDIT : F***CK misunderstood haha, this script is very bad coded

 
Last edited by a moderator:
actually that error has absolutely NOTHING to do with "instance" npcs, but with "NPC instances", or copies that it is self creating because it is really bad coded

 
Last edited by a moderator:
@GM Fenrir

just a rough guess, probably the issue is caused by these line

Code:
donpcevent "LMS_NPC::OnCheck";
 
Back
Top