obj
Shades
name = "Shades"
icon = 'shades.dmi'//dont have a base icon so cant make weights icon!lol
worn = 0
price = 158
verb
Wear()
if(src.icon == 'kidbase.dmi')
src.worn = 1
usr.overlays += 'gord.dmi'
usr << "You wear the [src.name]."
src.suffix = "Equipped"
if(src.worn == 1)
src:worn = 0
usr.overlays -= 'shades.dmi'//temp icon
usr << "You remove the [src.name]."
src.suffix = ""
else
src:worn = 1
usr.overlays += 'shades.dmi'
usr << "You wear the [src.name]."
src.suffix = "Equipped"
What im trying to achieave(Sp) Is To change the diffrent shades icon depending on what icon the src has at the time.
If you want me to elaborate more then please say, And i thank you for your time and effort if you help me.
So src.icon = 'shades.dmi'
Which means that for /obj/Shades the first if statement will never return true (never execute it's indented code block). Try switching src to usr for your if statement. I think that is what you intended to do in the first place. You were meaning that if the usr's icon is 'kidbase.dmi' correct?
Also when the first if statement is executed the second if statement will always execute. Meaning that you will always "wear" src but then always remove it right afterwards.
The second if statement should be an else if.
Oh and from the looks of it the first if statement--when it does work--will allow people to wear more than one pair of shades. Which isn't currently a problem since they will be removed shortly thereafter when the second if executes.