Check if a door is locked or not.

filt This may be a newbie questions. But i need some help. I want to be able to lock and unlock doors without opening them. But i cant find a way to check if the door is locked or not.


(if(send gEgo:has(INV_KEY))


This checks of i have the key.


(if( == (aDoor:doorState) DOOR_OPEN)


This checks if the door is open.

But i cant find a way to check if the door is locked...





And then i have another problem...



(instance RoomScript of Script
   (properties)
   (method (handleEvent pEvent)


If i want the (method (doit), where should i put it?.. it seems as it doesnt work anywhere for me. I know the questions may be lame, but im new to this...
Eigen Hope this helps. Add var DoorOpened = FALSE under Main.sc
Here's the code:

(if(Said('unlock/door'))
(if(send gEgo:has(INV_TEST_OBJECT))
Print("You use your key to open the door.")
= DoorOpened TRUE
return
)
Print("You don't have a key.")
)


(if(Said('take/key'))
(if(send gEgo:has(INV_TEST_OBJECT))
Print("You alredy took it.")
return
)
Print("OK")
(if(send gEgo:get(INV_TEST_OBJECT))
)
)
(if(Said('open/door'))
(if(send gEgo:has(INV_TEST_OBJECT))
if(DoorOpened)
(aDoor: open)
return
)
Print("It's locked.")
return

)




-Eigen
filt I just cant get it to work. I cant find where to add "var DoorOpened = FALSE" in Main.sc
Eigen In Main.sc don't use "var DoorOpened = FALSE" but "DoorOpened = FALSE"Add it right after:

gTheMusic