ID:165128
 
How would you make a gender-only door?
And how would I make it so you only have the Open command when your next to the door?

Here is the code I have now:
Bump(atom/O)
..()
if(istype(O,/obj/Girls_Only_Door))
if(usr.gender == "female")
O:opacity = 0
O:density = 0
O:icon_state = "girl_open"
usr << "You open the door."
sleep(100)
O:opacity = 1
O:density = 1
O:icon_state = "girl"
view(5) << "The door closes."
else
usr << "You try to open the door, but it is locked."
if(istype(O,/obj/Boys_Only_Door))
if(usr.gender == "male")
O:opacity = 0
O:density = 0
O:icon_state = "boy_open"
usr << "You open the door."
sleep(100)
O:opacity = 1
O:density = 1
O:icon_state = "boy"
view(5) << "The door closes."
else
usr << "You try to open the door, but it is locked."


I used to have that code as a verb in the door object, but the verb wouldn't show up. I also tried giving a turf the code, but it still didn't work.

How do I get it to work?
So...much..colon...abuse...
Bump is a mob's proc. So try 'mob/Bump(atom/O)' instead of just 'Bump(atom/O)'
In response to Atomixkid
Actually, it also works with objects because objects are movable too.
Read the DM Guide. It will teach you how to properly override procs, use arguments (and not 'usr' in procs - Ugh) and how to.. get verbs to appear. And you have needless colon abuse there, using the dot operator would work just fine as you've typecasted it correctly.
As specified, a Bump() is an object-attached proc. It belongs to the object that did the move, you need to get that right.
In response to Beatmewithastick
Well, to clarify, not all atoms or objects but only /atom/movable's can move -- which includes only mobs and objs.
Also, 'objs' (objects of type /obj) and 'objects' (any data object - lists, clients, datums, mobs, objs...) are not the same; you may have referred to them as equal, though, so try not to confuse between them.