ID:155580
 
Is there any way to save Hair and when some one changes it we can change the hair style without keeping the old one there
probably if you saved the persons overlay or usr.hair something like anyway.if you need more specific advice tell me
In response to Dj dovis
mob/verb/Change_hair()
switch(input("Choose a hairstyle.","Hair") in list ("Hair1","Hair2"))
if("Hair1")
usr.overlays-='hair1.dmi'//deletes hair 1
usr.overlays-='hair2.dmi'//deletes hair 2
usr.overlays+='hair1.dmi'//adds on hair 1
//Note: Make sure the hair icon is in its OWN dmi file.
if("Hair2")
usr.overlays-='hair1.dmi'//deletes hair 1
usr.overlays-='hair2.dmi'//deletes hair 2
usr.overlays+='hair2.dmi'//adds on hair 2
In response to Xirre
will it also work after loading a game
In response to Xirre
Sorry, not correct.
Hello,

To save all overlays, you need to make sure src.overlays is being written to the save file. To add a specific hair icon, you will need to store that to a variable and save that variable to the save file.

To add/remove the overlay:



mob/var/obj/overlay/hair // to save the instace in
mob/verb/add_hair()
if(hair) src.overlays -= hair // remove the old hair
hair = new/obj/overlay/hair //create a new hair
//perform any icon operations here
src.overlays+=hair //add new hair