ID:264699
 
Code:
obj/desk
Request_Shop_Desk_DoorW
name = "Door"
icon = 'objects.dmi'
icon_state = "DeskDoorClosed"
density = 1
opacity = 0
Bump(mob/M, obj/O)
if(M.gfx==1)
O.density = 0
icon_state = "DeskDoorOpenW"
sleep(10)
O.density = 1
icon_state = "DeskDoorClosed"
else
usr<<"This door is locked!"
return


Problem description: I'm having trouble opening this door with the Bump proc. I've even tried a verb, but that doesn't work either

I assume your desk doesn't move around? Bump and Bumped are different, You want to move this into a mobs Bump event, it will require recodeing.

Note:Bumped isn't a proc
In response to Gigimoi
Can you show me an example? I really don't understand it that much. My desk does not move, no.
In response to Ryu-Kazuki
mob
Bump(obj/desk/D)
if(istype(D,/obj/desk))
del D

Feel angry? esplode a desk by running into it.
In response to Gigimoi
Thanks, I got it now
In response to Gigimoi
That is a very, very poor way of doing things.

The proper way is to define a Bumped() proc:

atom/proc/Bumped(atom/movable/M)
// Do nothing

atom/movable/proc/Bump(atom/A)
A.Bumped(src)
..()

// Now use our new Bumped() proc:
turf/door/Bumped(mob/M)
src.open()
In response to Garthor
i'm aware its horrible, He asked for something simple
In response to Gigimoi
There is, in fact, no excuse for providing bad code.
In response to Gigimoi
Simple and good are not mutually exclusive, spanky. If you can't do it, wait for someone who can.