ID:1889476
 
(See the best response by Rickoshay.)
Hey so I tried to code equipping T-Shirt. I was able to make it an obj even allow it to be picked up and put into the inventory, but no matter what when I try to put it on it does not show on the icon.

Code:
obj
var
worn = 0

obj
clothshirt
name = "Shirt"
icon = 'Clothes.dmi'
icon_state = "T-Shirt"
verb
Wear()
if(src.worn)
src.worn = 0
usr.overlays -= "T-Shirt"
else
src.worn = 1
usr.overlays += "T-Shirt"
Drop()
if(src:worn == 1)
usr << "Not while its being worn."
if(src:worn == 0)
src.loc=locate(usr.x,usr.y-1,usr.z)
Get()
set src in oview(1)
src.loc = usr
usr<<"You picked up a [src]"


Problem description:

usr.overlays += "T-Shirt"

//should be
usr.overlays+= src
I tried usr.overlays + = src

it did not work
I suggest you read this.

http://www.byond.com/docs/ref/info.html#/atom/var/overlays

Take note of the FLOAT_LAYER as well.
I couldn't understand it
Best response
Really? You should read the DM Guide then. If this doesn't help someone more knowledgeable than I will need to help you. You're also going to want to have things in place to stop players wearing say, more than one piece of clothing in the same area. Can't have someone walking around with every piece of clothing on the game on.

obj
clothes
var
worn
verb
wear()

shirt
layer = FLOAT_LAYER-1 //say if you have armour in your game. You want armour above your shirt? So armour would be -1 this would be -2.

wear()
if(src.worn)
src.worn = 0
usr.overlays -= src //remove the shirt from the player
else
src.worn = 1
usr.overlays += src //add the shirt to the player.