ID:145239
 
Code:
obj/shirt
icon = 'Clothes.dmi'
icon_state = "shirt"
verb
Get()
set src in oview(1)
src.Move(usr)
usr << "You have picked up a shirt."
Wear()
if(usr.shirt == 0)
usr.overlays += 'Clothes.dmi'
usr.shirt = 1
usr.Def += 2
usr.Str += 2
usr << "You wear a shirt."
else
usr.shirt = 0
usr.overlays -= 'Clothes.dmi'
usr.Def -= 2
usr.Str -= 2
usr << "You take of the shirt."


Problem description: I tried making a simple shirt that you can equipt onto you. Why isn't it working?

Think about Icon states. Does the actual Icon state in the icon have the same name? If it does it won't show up from what I know.
In response to RedlineM203
Yeah, thanks. I just took out the icon_state and it works just fine.
Among other problems, your equipment system is set up wrong. usr.shirt should be set to the shirt itself when equipped, or null when none is in use. Knowing you have a shirt equipped is nothing next to knowing which one, and a single var can tell you both.

Also, though fixing your equipment system eliminates this problem, you should never ever use if(var==0) to test if a value is false, or likewise if(var==1) to test truth. Instead use if(!var) and if(var), respectively.

Lummox JR