Jump to content
  • 0
Sign in to follow this  
winter_07

About script

Question

5 answers to this question

Recommended Posts

  • 0

You could do this a few ways, if it's a custom map than make a wall and set the gat for that part to non-walkable then disable flywings. If it's meant to be purely script based... it gets a bit harder. You'll want to make sure the map has fly wings disabled. Then if it's like a hallway or something put an invisable npc with a large radius area and put OnTouch:: so that when a player trys to walk passed that area, they walk onto the npc and get pushed back to the area they are meant to be in. Thats just some ways @.@ there are other methods.

Share this post


Link to post
Share on other sites
  • 0

You can do something like this:

 

setcell "map",<x1>,<y1>,<x2>,<y2>,cell_walkable,0; //Player can't walk on cellsetcell "map",<x1>,<y1>,<x2>,<y2>,cell_walkable,1; //Player can walk on cell

More info in doc/script_commands.txt in setcell part

And you can use npc like barricade to create the wall and hide them when you want to let player walk in.

 

-	script	barricade_management	-1,{end;OnBarricadeOn:enablenpc "Barricade";enablenpc "Barricade#2";ect.... // add as many barricades you needsetcell "map",<x1>,<y1>,<x2>,<y2>,cell_walkable,0; //Player can't walk on cell when the barricades are onend;OnBarricadeOff:disablenpc "Barricade";disablenpc "Barricade#2";ect.... // add as many barricades you needsetcell "map",<x1>,<y1>,<x2>,<y2>,cell_walkable,cell_walkable,1; //Player can walk on cell when the barrides are offend;}map,x,y,0	script	Barricade#1::Barricade	1906,{  //location of your barricade npcend;OnEffect1:	specialeffect 402;  // You can put an effect to get something cool  ;)end;}map,x,y,0	duplicate(Barricade)	Barricade#2	1906  //location of your second barricade npcect... // add as many barricade you need

Share this post


Link to post
Share on other sites
  • 0

no, don't use setcell, that will glitch the client

always use setwall

prontera,158,182,6	script	barricade	101,{	if ( has_instance2( "guild_vs2" ) >= 0 ) {		warp has_instance( "guild_vs2" ), 0,0;		end;	}	.@pid = getcharid(1);	if ( !.@pid ) {		mes "form a party 1st";		close;	}	getpartymember .@pid, 1;	getpartymember .@pid, 2;	if ( ( .@ins = instance_create( "test barricade", .@pid ) ) < 0 ) {		mes "error : "+ .@ins;		close;	}	if ( instance_attachmap( "guild_vs2", .@ins, 1, .@pid +"wall" ) == "" ) {		mes "error : 5";		instance_destroy .@ins;		close;	}	instance_set_timeout 30, 0, .@ins;	instance_init .@ins;	instance_attach .@ins;	switch ( rand(4) ) {		default: warp has_instance( "guild_vs2" ), 50, 90; break;		case 1: warp has_instance( "guild_vs2" ), 50, 9; break;		case 2: warp has_instance( "guild_vs2" ), 9, 50; break;		case 3: warp has_instance( "guild_vs2" ), 90, 50; break;	}	end;}guild_vs2,0,0,0	script	djfksdhfjkds	-1,{OnInstanceInit:	setwall has_instance( "guild_vs2" ), 46,87, 8, 6, 0, "inst_"+ has_instance2( "guild_vs2" ) +"_barricade_1";	setwall has_instance( "guild_vs2" ), 87,53, 8, 4, 0, "inst_"+ has_instance2( "guild_vs2" ) +"_barricade_2";	setwall has_instance( "guild_vs2" ), 46,12, 8, 6, 0, "inst_"+ has_instance2( "guild_vs2" ) +"_barricade_3";	setwall has_instance( "guild_vs2" ), 12,53, 8, 4, 0, "inst_"+ has_instance2( "guild_vs2" ) +"_barricade_4";	sleep 10000;	delwall "inst_"+ has_instance2( "guild_vs2" ) +"_barricade_1";	delwall "inst_"+ has_instance2( "guild_vs2" ) +"_barricade_2";	delwall "inst_"+ has_instance2( "guild_vs2" ) +"_barricade_3";	delwall "inst_"+ has_instance2( "guild_vs2" ) +"_barricade_4";	end;}

Share this post


Link to post
Share on other sites
  • 0

prontera,158,182,6	script	barricade	101,{	if ( has_instance2( "guild_vs2" ) >= 0 ) {		warp has_instance( "guild_vs2" ), 0,0;		end;	}	.@pid = getcharid(1);	if ( !.@pid ) {		mes "form a party 1st";		close;	}	getpartymember .@pid, 1;	getpartymember .@pid, 2;	if ( ( .@ins = instance_create( "test barricade", .@pid ) ) < 0 ) {		mes "error : "+ .@ins;		close;	}	if ( instance_attachmap( "guild_vs2", .@ins, 1, .@pid +"wall" ) == "" ) {		mes "error : 5";		instance_destroy .@ins;		close;	}	instance_set_timeout 30, 0, .@ins;	instance_init .@ins;	instance_attach .@ins;	switch ( rand(4) ) {		default: warp has_instance( "guild_vs2" ), 50, 90; break;		case 1: warp has_instance( "guild_vs2" ), 50, 9; break;		case 2: warp has_instance( "guild_vs2" ), 9, 50; break;		case 3: warp has_instance( "guild_vs2" ), 90, 50; break;	}	end;}guild_vs2,0,0,0	script	djfksdhfjkds	-1,{OnInstanceInit:	setcell has_instance( "guild_vs2" ), 46,87,53,87,cell_walkable,0;	setcell has_instance( "guild_vs2" ), 46,12,53,12,cell_walkable,0;	setcell has_instance( "guild_vs2" ), 12,46,12,53,cell_walkable,0;	setcell has_instance( "guild_vs2" ), 87,46,87,53,cell_walkable,0;	sleep 10000;	setcell has_instance( "guild_vs2" ), 46,87,53,87,cell_walkable,1;	setcell has_instance( "guild_vs2" ), 46,12,53,12,cell_walkable,1;	setcell has_instance( "guild_vs2" ), 12,46,12,53,cell_walkable,1;	setcell has_instance( "guild_vs2" ), 87,46,87,53,cell_walkable,1;	end;}
seems that you are right ... I couldn't walk pass...

 

maybe it will only glitch when you setcell in the sight range of the character

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

  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  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.