ID:268876
 
door
name = "door"
icon = 'door.dmi'
switch_door
icon_state = "switch"
var/closetime = 20
var/open
proc
Open()
src.open++
src.density = 0
src.icon_state = "q"
spawn(src.closetime)
src.Close()
Close()
src.open=null
src.density = 1
src.icon_state = "switch"


switches
parent_type = /turf
name = "switch"
var/in_use
var/d
switch_
icon = 'objects.dmi'
icon_state = "switch"
Entered(mob/M)
if(!src.in_use)
if(ismob(M))
src.trigger()
proc/trigger()
src.in_use = 1
src.icon_state = "switch_on"
for(var/door/switch_door/D in view(src))
if(D)
if(!D.open)
d++
if(d<2)
D.Open()
spawn(D.closetime)
src.icon_state = "switch"
src.in_use=null
src.d=null


Is there a better way to do this? Also, will this show to be non-buggy when I play with other players?