ID:264698
 
Code:
mob/NPC/Hair_Stylist
icon = 'NPCs.dmi'
icon_state = "Hair Stylist"
density = 1
verb
Talk()
set src in view(1)
usr<<"Hair Stylist: If you'd like, I can give you a new haircut."
sleep(15)
switch(input("Would you like a new hairstyle?", "Hair") in list ("Yes", "No"))
if("Yes")
switch(input("What hairstyle would you like?", "Hair") in list ("Ichigo", "Cancel"))
if("Ichigo")
usr.hairstyle = "hairichigo.dmi"
usr.overlays += usr.hairstyle
if("Cancel")
return
if("No")
return


Problem description: The hair won't appear on the mob. I'm not entirely sure how to put the overlay on without making it an object, and that's not what I want to do.

You're applying text as an overlay. Quotation marks ("") are used for text strings. You're looking for single quotes (''), to define an icon.

usr.hairstyle = 'hairichigo.dmi'


PS: As a sidenote, there's no use to adding if("Cancel") return or if("No") return, if you don't use a switch()'s returned value, it'll do nothing on its own.
In response to Emasym
I just had the "Cancel" there for the test version. Thanks anyway
In response to Emasym
this would be another way,

usr.overlays += icon('hairichigo',"<AN ICONSTATE>")

If you needed to use icon_states for it.
In response to Gigimoi
icon objects aren't the most effective way to handle overlays merely for the sake that they don't have the full range of features that atomic objects do. I advise using an Obj for overlays simply because they are easier to remove, and you can use pre-assigned layers with them.

If you do use a layer-sorting system for clearing/refreshing icons, there's no point to creating an icon object in the first place anyway. It's easier to just use the icon itself... UNLESS you are going to be changing the color/scale/etc. of the icon before applying it.