ID:141187
 
Code:
mob/Auror/verb/AurorRobes()
set category = "Aurors"
set name = "Auror Robes"
if(usr.trans)
usr << "You can use this while you are transformed"
return
if(usr.robes)
if(usr.icon_state == "Auror")
usr.icon = 'icons/base.dmi'
usr.icon_state = usr.oldtransicon
usr.oldtransicon=null
usr.robes = 0
else if(!usr.icon_state == "Auror")
usr.icon = 'icons/base.dmi'
usr.icon_state = usr.oldtransicon
usr.oldtransicon=null
usr.robes = 0
if(!usr.robes)
usr.oldtransicon = usr.icon_state
usr.icon = 'icons/base.dmi'
usr.icon_state = "Auror"
usr.robes = 1


Problem description:
The problem is that the robe now does undo and change me back dont know why?
I had problems with icons it if I used one robe then used another then took off that one and the other one it left the base icon invisible this is because the oldtransicon cant store more than one change and bugged so I made this but its not working. There is another two codes like this on for DE and another for Admin can anyone help?
I'm not sure I understand your problem:

Use Robe A
Use Robe B (Is this possible? Thought you couldn't use a second robe?)
Remove Robe B
Robe A is still there, and base icon is null(?)
Some problem with oldtransicon(?)

Could you try and clarify?

The only thing that I can see might being a problem, is that oldtransicon might be null when you're setting usr.icon_state = usr.oldtransicon?
I don't really understand your problem either, but your if(!usr.robes) check is problematic. Just before it you're setting the var to 0, so it will execute even if the var wasn't originally false. Either way you should've only checked the var once anyway, instead of twice... read up on the if statement and use else. Similar deal with your else if(!usr.icon_state == "Auror"), ugh, why try that instead of just using an else and not an else if? Besides, that check is probably faulty, and to do that right you need to do if(!(icon_state == "whatever")) or if(icon_state != "Auror") instead.
In response to K'ros Trikare
Hmm yep thats the problem so Im trying to get it so you cant wear 2 robes thats what I was explaining sorry I really feel bad I made this really quick and have not been on in a few days im sorry. Im going to try and tackle the problem with both your advice now thanks ill keep this updated if theres a problem and ill be active and better explanation.