Jump to content
  • 0

warp custom with item


Question

13 answers to this question

Recommended Posts

  • 0
Posted
prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	mes "Warp to "+.map$+" ?";
	if (.item_id_size) {
		for (.@i = 0; .@i < .item_id_size; .@i++) {
			mes "> "+.item_qty[.@i]+"x "+getitemname(.item_id[.@i]);
			if (countitem(.item_id[.@i]) < .item_qty[.@i])
				.@failed++;
		}
	}
	if (select("Warp", "Cancel") == 1) {
		if (.@failed) {
			mes "You didnt have enough items.";
		}
		else {
			if (.item_id_size)
				for (.@i = 0; .@i < .item_id_size; .@i++)
					delitem .item_id[.@i], .item_qty[.@i];
			warp .map$, 0, 0;
		}
	}
	close;
	
	OnInit:
		.map$ = "prontera";
		setarray .item_id, 501, 502, 503;
		setarray .item_qty, 100, 200, 300;
		.item_id_size = getarraysize(.item_id);
		end;
}

 

  • Upvote 2
  • 1
Posted (edited)
prontera,150,150,4	script	Warpme!	999,{
	.@itemreq = 501;
	.@itemamt = 10;
	mes "What do you want?";
	next;
	if(select("Warp me!","Cancel") == 2) close;
	
		if(countitem(.@itemreq) < .@itemamt){
			mes "Im sorry you dont have enough items in your inventory.";
			end;
		}
		delitem .@itemreq,.@itemamt;
		warp "payon",0,0; // change this to you map
	end;
}

 

Edited by Radian
  • Upvote 1
  • 0
Posted (edited)
mes "warp me";
next;
switch(select("Yes:No"){
  case 1:
  	if (countitem(item_id) < 1){
          mes "You need XXX item to use our service";
          close;
      }
  	warp "prontera",156,182;
  	end;
  case 2:
    close;
}
 

 

Edited by melv0
  • Upvote 1
  • 0
Posted
1 hour ago, melv0 said:

mes "warp me";
next;
switch(select("Yes:No"){
  case 1:
  	if (countitem(item_id) < 1){
          mes "You need XXX item to use our service";
          close;
      }
  	warp "prontera",156,182;
  	end;
  case 2:
    close;
}
 

 

Hey melv0

 

how would you make this script look for multiple items before warping the player

  • Upvote 1
  • 0
Posted
18 hours ago, crossworld said:

Hey melv0

 

how would you make this script look for multiple items before warping the player

if (countitem(item_id) < 1 || countitem(item_id) < 1)

 

11 hours ago, skuray said:

não funciona ?

can u tell me what error on console?

  • Upvote 1
  • 0
Posted
13 minutes ago, skuray said:

not the sequence of errors, just does not work
??


prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:
    close;
}

 

its be cause you only have 1 case when its made for 2

  • Upvote 1
  • 0
Posted
17 minutes ago, skuray said:

how could be the casa 2?

prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){   <---------------HERE ONE CASE
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:                          <----------------HERE SECOND CASE
    close;
}
  • Upvote 1
  • 0
Posted
4 minutes ago, crossworld said:

prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){   <---------------HERE ONE CASE
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:                          <----------------HERE SECOND CASE
    close;
}

thank u!!! 
can u help me in the this script pls?

 

  • 0
Posted
2 hours ago, skuray said:

not the sequence of errors, just does not work
??


prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:
    close;
}

 

You're having problems because (1) You're using a select function with only one menu option "Game of Thrones", and (2), you do not have balanced braces.

Syntax error, expected )

switch(select("Game of Thrones"){

Has 2 open braces (
and only one close brace )

switch(select("Game of Thrones", "Option 2")){

Checking for multiple conditions

You can check for multiple conditions using the conditional operators AND or OR.

if (countitem(501) > 0 && countitem(601) > 0) {
	mes "You have red potion AND fly wing at the same time!";
}

if (countitem(501) > 0 || countitem(601) > 0) {
	mes "You have red potion or a fly wing... or BOTH!";
}

See doc/script_commands for a full guide on NPC and item scripting.

  • Upvote 1
  • 0
Posted
7 hours ago, iwillnot said:

Você está tendo problemas porque (1) você está usando uma  função de seleção com apenas uma opção de menu "Game of Thrones", e (2), você não tem chaves equilibradas.

Erro de sintaxe, esperado)


Tem 2 chaves abertas (
e apenas uma chave fechada )


Verificando várias condições

Você pode verificar várias condições usando os operadores condicionais AND ou OR .



Veja doc / script_commands  para um guia completo sobre NPC e scripts de itens.

Thank u s2

6 hours ago, Radian said:

	
	  
	  
	  
	
		  
		 

 

Thank U

  • -1
Posted (edited)
21 minutes ago, melv0 said:

can u tell me what error on console?

not the sequence of errors, just does not work
??

prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:
    close;
}

 

Edited by skuray

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...