Jump to content
  • 0

Can someone point to me what i did wrong with this script


Question

Posted (edited)

i got this error

[Error]:
script error on npc/custom/guild_hall.txt line 637
    expect ';' or '{' at function syntax
   635 : {
   636 :
*  637 :        function        script' 'F_restore      {
   638 :        .@rental_item = getarg(0);
   639 :        .@second_item = getarg(1);
   640 :        .@third_item = getarg(2);
   641 :        .@give_item = getarg(3);
   642 :

and here is the script, also is the script even correct ??

anyone have more simpler way for this script ?

i was trying or testing..

Spoiler
moc_para01,51,33,4	script	Guild Blacksmith2	826,{
	
function	script	F_restore	{
	.@rental_item = getarg(0);
	.@second_item = getarg(1);
	.@third_item = getarg(2);
	.@give_item = getarg(3);
	
	if(rentalcountitem(.@rental_item) < 1){
		clear;
		mes "You don't have a "+ getitemname(.@rental_item) +".";
		close;
	}
	if(countitem(.@second_item) < 1){
		clear;
		mes "You don't have a "+ getitemname(.@second_item) +"."; 
		close;
	}
	if(countitem(.@third_item) < 10){
		clear;
		mes "You don't have 10 "+ getitemname(.@third_item) +"."; 
		close;
	}
	
	clear;
	soundeffect "menu.wav",0;
	mes "^ce7e00 === Hafiz === ^000000";
	mes "Great, here is your new "+ getitemname(.@give_item) +".";
	delitem (.@rental_item), 1;
	delitem (.@second_item), 1;
	delitem (.@third_item), 10;
	getitem (.@give_item), 1;
	close;

}
	
	soundeffect "menu.wav",0;
	mes "^ce7e00 === Hafiz === ^000000";
	mes "Yes how can i help you ?";
	switch(select("- Restore:- Cancel")){
		case 1:
								//rental,1st,2nd,reward
			callfunc "F_restore",40005,40225,40016,40004;
		case 2:
			end;
	}

}

 

 

Edited by Dolphin86

2 answers to this question

Recommended Posts

  • 0
Posted

fixed !

Spoiler
moc_para01,51,33,4	script	Guild Blacksmith2	826,{

function	F_restore	{
	.@rental_item = getarg(0);
	.@item_1 = getarg(1);
	.@item_2 = getarg(2);
	.@item_3 = getarg(3);
	
	if(rentalcountitem(.@rental_item) < 1){
		clear;
		soundeffect "menu.wav",0;
		mes "^ce7e00 === Hafiz === ^000000";
		mes "You don't have a "+ getitemname(.@rental_item) +".";
		close;
	}
	if(countitem(.@item_1) < 1){
		clear;
		soundeffect "menu.wav",0;
		mes "^ce7e00 === Hafiz === ^000000";
		mes "You don't have a "+ getitemname(.@item_1) +"."; 
		close;
	}
	if(countitem(.@item_2) < 10){
		clear;
		soundeffect "menu.wav",0;
		mes "^ce7e00 === Hafiz === ^000000";
		mes "You don't have 10 "+ getitemname(.@item_2) +"."; 
		close;
	}
	
	clear;
	soundeffect "menu.wav",0;
	mes "^ce7e00 === Hafiz === ^000000";
	mes "Great, here is your new "+ getitemname(.@item_3) +".";
	delitem (.@rental_item), 1;
	delitem (.@item_1), 1;
	delitem (.@item_2), 10;
	getitem (.@item_3), 1;
	close;

}
	
	soundeffect "menu.wav",0;
	mes "^ce7e00 === Hafiz === ^000000";
	mes "Yes how can i help you ?";
	switch(select("- Restore:- Cancel")){
		case 1:
								//rental,1st,2nd,reward
			F_restore(40005,40225,40016,40004);
		case 2:
			end;
	}

}

 

 

  • 0
Posted (edited)

The error already said what error you got sir

 

[Error]:script error on npc/custom/guild_hall.txt line 637 expect ';' or '{' at function syntax


 

Edited by Poring King

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