ID:146469
 
Code:
turf
desk
icon ='turf.dmi'
icon_state ="desk"
density=1
verb
Open()
set src in view(1)
var/open =0
if(usr.open == 0)
M.icon_state ="deskopen"
M.open =1
else
M.icon_state ="desk"
M.open =0


Problem description:
I want it so when you click open the desk changes to the deskopen icons state and when u press it again it closes

turf
desk
icon ='turf.dmi'
icon_state ="desk"
density=1
var/open=0
verb
Open()
set src in view(1)
if(!src.open)
src.icon_state ="deskopen"
src.open =1
usr << "[src] was opened"
else
src.icon_state ="desk"
src.open =0
usr << "[src] was closed"


That should help =P.
In response to N1ghtW1ng
thanks