ID:261239
 
Fix my code(as usual) green line is whats wrong. Thx in adv



mob/verb/Open()
set category="Commands"
if(src.icon_state=="closed")
usr << "The door opens!"
sleep(10)
src.icon_state="opened"
else
usr << "ITS OPEN!"


turf/door
door
icon = 'door.dmi'
icon_state = "closed"


Errors:

loading game.dme
doorcode.dm:3:error::invalid expression

game.dmb - 1 error, 0 warnings (double-click on an error to jump to it)

I wont fix your code, but Il tell you the following:


1. The indentation is wrong, why is the if else statement indented one further?

2. I doubt it does what you want. That sets src's icon state(which is the player using it) to closed, if its open. In the verbs case src and usr are identical

Alathon