ID:1216241
 
(See the best response by Murrawhip.)
I try acess one obj in usr.overlays but i can't , anybody knwo how make this?

first i try this code but not work
for(var/obj/Hair/S in usr.overlays)
S.icon_state="[NumberHair]"

Please Help me
Are you using a verb? If you are in a proc you should not be using usr. Please use <dm> tags so we can see the code. More code than this would also be helpful to find the issue. At least post the whole section of code this is in.
Best response
One method is to keep the overlays in a separate list and then apply them when necessary.

mob/var/list/Overlays = list()

mob
proc
addOverlay(var/o)
Overlays.Add(o)
applyOverlays()
removeOverlay(var/o)
Overlays.Remove(o)
applyOverlays()
applyOverlays()
src.overlays = Overlays


That way you can modify the objects in Overlays and then call applyOverlays() for the changes to take effect.