Hi!
Flatlander, I can tell you I have a new "best friend" hahaha, you are amazing man you solve the entire problem in the same script, really THANKS! I´m in debt with you.
This will be used in a educational game for kids to learn to spell right, as soon as I have the demo version I will post it. Thanks to everybody was involved.
Here there is the script modified to open the door as soon you type the last correct letter:
;;Artificial Intelligence Script
;by Flatlander / modified by MaxTol
;Header
desc = enter a password to open a remote door
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\enteraccesscode.tga,hudname=keyprompt,hudhide=1,hudmak
e=display
:state=0:hudreset,hudx=50,hudy=50,hudimagefine=gamecore\text\11.dds,hudname=11,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=50,hudimagefine=gamecore\text\22.dds,hudname=22,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=50,hudimagefine=gamecore\text\33.dds,hudname=33,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=50,hudimagefine=gamecore\text\44.dds,hudname=44,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=70:hudshow=keyprompt,state=15
:state=10,plrdistfurther=70:state=50
:state=15,plrdistwithin=70,scancodekeypressed=37:hudunshow=keyprompt,hudshow=11,sound=audiobank\switches\press.wav,
state=20,timerstart
:state=15,plrdistfurther=70:state=50
:state=20,plrdistwithin=70,timergreater=500,scancodekeypressed=23:hudshow=22,sound=audiobank\switches\press.wav,sta
te=25,timerstart
:state=20,plrdistfurther=70:state=50
:state=25,plrdistwithin=70,timergreater=500,scancodekeypressed=38:hudshow=33,sound=audiobank\switches\press.wav,sta
te=30,timerstart
:state=25,plrdistfurther=70:state=50
:state=30,plrdistwithin=70,timergreater=500,scancodekeypressed=38:hudshow=44,sound=audiobank\switches\press.wav,sta
te=35
:state=30,plrdistfurther=70:state=50
:state=35:setframe=0,incframe=0,sound=$0,activateifused=1,coloff,state=60
:state=50:hudunshow=keyprompt,hudunshow=11,hudunshow=22,hudunshow=33,hudunshow=44,state=55
:state=55,plrdistfurther=70:state=0
:state=60:hudunshow=keyprompt,hudunshow=11,hudunshow=22,hudunshow=33,hudunshow=44,state=65
:state=65:none
;End of Script