Jump to content
  • 0

Need help for checking value.


BigBurrito

Question


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.02
  • Content Count:  114
  • Reputation:   5
  • Joined:  07/16/16
  • Last Seen:  

Hi everyone. I need help to check a value on this loop. I have it this way but it is not working for me.

 

- 	script CheckValue	-1,{

OnCheck:
for (set @i,1; @i<4; set @i,@i+1){
		if ($@using[@i] == 0)
		mes "Number "+ @i +" is available.";
		set @numberavail,1;
		close2;
		break;
	
	}
if(@numberavail == 1){
						doevent "Number#[@i]::OnNumber";
						end;
					}
                     
                     
mes "No Number was available";
end;
}


- 	script	Number#1	-1,{

OnNumber:
if($@using[1] == 0){
                   	set $@using[1],1;
					mes "Hello, you are seeing Number 1.";
					sleep 10000;
					set $@using[1],0;
					end;
					}
end;    
}   

- 	script	Number#2	-1,{

OnNumber:
if($@using[2] == 0){
                   	set $@using[2],1;
					mes "Hello, you are seeing Number 2.";
					sleep 10000;
					set $@using[2],0;
					end;
					}
end;    
}      

- 	script	Number#3	-1,{

OnNumber:
if($@using[3] == 0){
                   	set $@using[3],1;
					mes "Hello, you are seeing Number 3.";
					sleep 10000;
					set $@using[3],0;
					end;
					}
end;    
}              


This Error appears.
[Error]: npc_event: event not found [Number#[@i]::OnNumber]

I know where the error is, but dont know how to make it work.
 

Edited by BigBurrito
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • -1

  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.02
  • Content Count:  114
  • Reputation:   5
  • Joined:  07/16/16
  • Last Seen:  

Solved

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