Password protected door

Sorry once again for my annoying posts, but I need help making a password protected door. I know it has something to do with detecting what the players text is, but i’m not exactly sure how to do this.

if(playerenters) show; if(playerchats && strequals(#c,I am Password)) hide;

Thanks again, but what exactly does strequals mean?

if their strenght equals X, eg if(strequals #c it means if they say a particular phrase.

Ohh that makes sense. So basically, it’s just detecting what the player says whenever they chat, and if that is equal to the text displayed in the script, it continues on with the script normally! Thanks!

strequals isnt only based on chat, it can be for lots of things like #a (account) #n (nickname) etc.

Wow you just saved me from creating another topic lol.

if (strequals) means if string equals

Why does graal need a function to compare strings really? Wouldn’t it be more logical to do if (#c == “ass”) ?

if(playerenters) show;
if(playerchats && strequals(#c,I am Password)){
hide;
sleep 3;
show;
}

i guess you could have a set password command as well hehe

if (playerchats && strequals(#g,Admin) && strequals(#c,set pass){
setplayerprop #c,Type password in the next 5 seconds;
sleep 5;
if (playerchats){
password=#c;
}
}

This is just an idea please dont kill me if im wrong o.0

muddled up help library?

#a the account name of the player #b line break (for say2) #C0, #C0(index) the skin color #C1, #C1(index) the coat color #C2, #C2(index) the sleeves color #C3, #C3(index) the shoes color #C4, #C4(index) the belt color #c, #c(index) the current chat text of the player #e(startindex,length,string) extracts a substring out of 'string' (length=-1 -> till the end) #f the image filename of the npc #g, #g(index) the guild name of the player #I(list,index) gets a string of a string list #i(imgname), #i(imgname,x,y,w,h) displays an image or a part of an image when used in a sign #K(keyindex) the name of the specified key #k(keyindex) the description of the specified key (in local language / key assignments) #L the current level filename #m, #m(index) the animation of the player #n, #n(index) the nick name of the player (index=-1 -> npc character, 0 -> current player) #P1, #P1(index) the gani attribute 1 (hat) #P2, #P2(index) the gani attribute 2 #P3, #P3(index) the gani attribute 3 #P4, #P4(index) the gani attribute 4 #P5, #P5(index) the gani attribute 5 #p(index) action parameter of the specified index #s(var) the value of the string variable 'var' #t(index) token of the specified index, produced with tokenize #T(string) trims the string (removes spaces at the beginning and end) #v(var) the value of 'var' as string #W, #W(index) the filename of the weapon icon #w,#w(index) the name of the current npc weapon of the player #1, #1(index) the sword image filename of the player #2, #2(index) the shield image filename of the player #3, #3(index) the head image filename of the player #5, #5(index) the image filename of the player's horse #6, #6(index) the image filename of the npc that is carried by the player #8, #8(index) the body image filename of the player

That’s from commands.rtf, yeah us m0r0ns have to help eachother out :stuck_out_tongue:

I’m not very good, but I don’t think that would work. I’m thinking something like this would do it.

if (created) {
  setimg door.png;
  setshape 1,32,32;
}
if (playerenters) { show; }
if (playerchats && strequals(#c, #s(server.password))) {
hide;
sleep 3;
show;}
if (playerchats && strequals(#a, zhuki)) {
tokenize #c;
if (strequals(#t(0),setpassword)) {
setstring server.password, #t(1);
setplayerprop #c, Done!;
}}
if (playertouchsme) { say2 Password, please?; }

if you want the password to only be 1 word yea…

else use
#e(startindex,length,string)
extracts a substring out of ‘string’ (length=-1 -> till the end)

(so #e(12,-1,#c) in that case)