ID:145445
 
Code:
obj
doors
doort//top part of door
icon = 'pics/walls.dmi'
icon_state = "door1"//top
layer = MOB_LAYER+1//sp when people walk through door they dont walk over the door
door1//bottom part of door
icon='pics/walls.dmi'
icon_state="door2"//bottom
density=1
Click()
set src in oview(0)
icon_state="Open" // changes the appearance
density=0
sleep(10)
icon_state="door2"//shut again
density=1
..()


Problem description:

Compiles and works but allows people from far away to click it. I want it so they have to be standing right next to the door to open it yet then can open it from rooms away.
You can't use set src in a proc. Instead, check something like if(usr in oview(src, 2)). This will check if usr(the clicking person) is within 2 spaces of src(the door).
In response to Jon88
thanks, it works fine now