ID:178973
Mar 7 2002, 6:48 pm
|
|
Alright I try as hard as possible to not be an annoying newbie that you all hate (notice no caps and only one question mark unlike most others) but i dont know how I could code this properly. Well, I am making doors for almost every place in my map and I would like them to be opened when you click on them but as soon as somebody passes over them they close again. That isnt really the biggest problem, I would like to be able to lock the doors by using a certian key on them. Could anybody tell me how to go about this without millions of miles of code to work with?
|
In response to English
|
|
Ok this is my first time ever answering a code question so I'll try my hardest.
var If you need any help with this code ill try to help you :P Hope I helped, Good luck |
As for the key problem, I've never actually implimented one before so someone else could probably give you a more efficient solution.
An approach that makes sense would be use a testing statment like this:
obj
lockdoor
var/key_type = /obj/blue_key //give each door a keytype
Click()
for(var/obj/key/K in usr.contents) //look for all keys in usr
if(istype(K,key_type))
//open door