Jump to content
  • 0

one at a time


benching

Question


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

I'm trying to create a NPC that can only be accessible one at a time,

And i can't figure out to make it behave like i want.

prontera,154,178,4	script	Hati	835,{
	
	OnInit:
		set .CanTalk,0;
		
		if(.CanTalk == 0) {
			set .CanTalk,1;
			mes "hello, world!";
			close2;
			set .CanTalk,0;
		}
		else
			mes "I'm talking to someone, please back in a moment";
				
	while (.CanTalk == 1)
	{
		specialeffect EF_BEGINSPELL6;
		sleep 425;
	}	
			
	end;
	
}

@Emistry

how to make the npc usable one at a time?

 

best regards /ene

Edited by Eat Sleep Dota
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

Try this.

prontera,154,178,4	script	Hati	835,{

	if(.CanTalk == 0) {
		set .CanTalk,1;
		mes "hello, world!";
		close2;
		set .CanTalk,0;
		end;
	}
	else {
		mes "I'm talking to someone, please back in a moment";
		end;
	}
				
	while (.CanTalk == 1)
	{
		specialeffect EF_BEGINSPELL6;
		sleep 425;
	}	
			
	end;
	
	OnInit:
		set .CanTalk,1;
	end;	
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

thanks man, it works now,
but you need to initialize value of CanTalk to 0,
else no one can talk to it :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

Uuuhhhhh well, mustve missed that. Anyway great then.

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