ID:170677
 
I don't ,mean like a user key. I mean like say there is a key in my inventory which when i use the key on a door, it opens the door. then i go in, then the door closes and locks afterwords. I'm needing it for a jail in a game i'm working on. I will give full credit if ne1 helps.

What the jail is for is like when like a person attacks a civilian in the game, police come and jail u. When u are in the jail. they pay a bail bond for a key to get out. when they get out, the key disappears and they are out of jail. The more times in jail, the higher the bail bond is. Its kinda like the online game Wyvern Client *A non byond game*
It's called Wyvern, you play it on a Client. :p
Urr I recently helped Hell Ramen with pretty much the same thing. So Hell Ramen if you see this, could you either give him the id of that post(I for some reason couldn't find it) or post the code you use/I gave you?

*EDIT*

Ok found it:

atom/proc/Bumped(atom/movable/bumped_by) //Declare a new proc for all atoms called Bumped.
atom/movable/Bump(atom/O)
if(O) O.Bumped(src) //Then make Bump call Bumped for the atom that was hit.

obj
door
density = 1
Bumped(atom/movable/A)
if(istype(A,/mob/Player))
var/mob/M = A
if(M.unlocked_doors.Find(src))
src.Open()
else
if(M.keys.Find(/obj/keys/key/correctkey))
M.unlocked_doors.Add(src)
M << "You can now open this door"
else
M << "You need the key!"


proc/Open()
world << "Pwned"
mob
verb
Gimme()
usr.keys.Add(/obj/keys/key/correctkey)

mob/var/list/unlocked_doors = list()
mob/var/list/keys = list()

obj
keys
key
correctkey


Ask if you don't understand parts of it.
In response to DeathAwaitsU
DeathAwaitsU wrote:
Urr I recently helped Hell Ramen with pretty much the same thing. So Hell Ramen if you see this, could you either give him the id of that post(I for some reason couldn't find it) or post the code you use/I gave you?

Yeah, I was going to edit my old post with it in a few seconds...let me search for it.
[edit]Post [link]