ID:139243
 
Code:
                        switch(input("What Hairstyle Would You Like?","Choose") in list ("Styled Bowl","Short","Pigtails","Medium","Nevermind..."))
if("Styled Bowl")
if(usr.hair>1) // if your gold is lower than 10 it will disallow you from purchasing it.
usr << "One Moment Sir" // tells you, that you cannot buy it.
usr.overlays=0
usr.hair-=1
else // otherwish you can purchase it.
usr.hair += 1 // subtracts 10 gold from your original
usr.overlays+=new/obj/Hair/Test
var/r = input("How much red?","Hair Color") as num//set its red amount
var/g = input("How much green?","Hair Color") as num//set its green amount
var/b = input("How much blue?","Hair Color") as num//set its blue amount
usr.overlays += rgb(r,g,b)// puts amounts into icon
usr << "Thank you and come again!"



Problem description: Im trying to create a system that allows you to change your haircolor and I plan to use the same system to change the color of clothing icons as well. However, although I get no errors from this code its sloppy and doesnt do anything. I think my problem is in how I adress what the color change targets. How should I word this?

I didn't compile this nor did I test this:
                        switch(input("What Hairstyle Would You Like?","Choose") in list ("Styled Bowl","Short","Pigtails","Medium","Nevermind..."))
if("Styled Bowl")
if(usr.hair>1) // if your gold is lower than 10 it will disallow you from purchasing it.
usr << "One Moment Sir" // tells you, that you cannot buy it.
usr.overlays=0
usr.hair-=1
else // otherwish you can purchase it.
usr.hair += 1 // subtracts 10 gold from your original
var/icon/Hair=new/obj/Hair/Test
var/colorthing = input("What color do you want?") as color
Hair.Blend(colorthing)
usr.overlays+=Hair
usr << "Thank you and come again!"
In response to Raimo
 runtime error: undefined proc or verb /obj/Hair/Test3/Blend().

proc name: Talk (/mob/Barber/verb/Talk)
usr: the tester (/mob/new_char)
src: Barber (/mob/Barber)
call stack:
Barber (/mob/Barber): Talk()



I get this runtime error whenI try to use the system
In response to JaffaJoke
Change the var to:
var/icon/Hair= new('iconname.dmi',"icon_state")
In response to Raimo
mob
Merchant
icon = 'TatsumotoTestOutfit.dmi'
verb
Talk()
set src in oview(1)
switch(alert("What would you like to do?","Shopkeeper","Buy","Cancel")) // \
pops open an alert which allows only 3 max options.

if("Buy") // if usr press buy this will enable the \
proc

switch(input("What would you like to buy?","Buy Item") in list ("Shorts","Shoes","Pants","Short Sleeved Shirt", "Long Sleeved Shirt", "Glasses", "Sunglasses", "Summer Dress", "Long Dress", "Skirt", "Kimono", "Blindfold", "Jumpsuit", "Bandolier", "Nevermind..."))
if("Shorts")
if(usr.gold<10) // if your gold is lower than 10 it will disallow you from purchasing it.
usr << "You cannot afford this!" // tells you, that you cannot buy it.
return
else // otherwish you can purchase it.
usr.gold -= 10 // subtracts 10 gold from your original
var/icon/Clothes= new('Clothing.dmi',"Shorts")
var/colorthing = input("What color do you want?") as color
Clothes.Blend(colorthing)
set src(/icon/Clothes)
src.Move(usr)
usr << "Thank you and come again!"
return



Alright, now I am trying to change the system to be useable with my shopkeeper. But im running into an issue of how to target the object, change it, and then move it to the inventory