Jump to content
  • 0

Simple Password activated NPC


healthydude

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   2
  • Joined:  02/05/13
  • Last Seen:  

Hey guys, I'm looking for a simple password activated NPC. For example, my password is "donkey"  and when someone enters the password donkey in the NPC, they will be given an Apple.

Is that possible?

healthydude

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

input @code$;
if(@code$ != "1234") {

 

change the variable type to STRING ....since you are comparing with a STRING and not NUMERIC characters.

 

or...

input @code;
if( @code != 1234 ) {
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  


- script Sample -1,{

OnWhisperGlobal:

if( @whispervar0$ == "donkey" ){

getitem 512,1;

}

end;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   2
  • Joined:  02/05/13
  • Last Seen:  

-	script	Sample	-1,{
OnWhisperGlobal:
	if( @whispervar0$ == "donkey" ){
		getitem 512,1;
	}
	end;
}

A script something like this bro: 

    mes "enter your password";
    set @code_,0;
    input @code_;
    if(@code_ != "1234") {
    mes "this is wrong";}
    mes "password is correct";
    mes "joke, its wrong";
    close;
    end;

but that doesn't work T_T

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   2
  • Joined:  02/05/13
  • Last Seen:  

Thank you VM, but is there a possible way to allow a player to change his @code$ by just doing some simple NPC instance?

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