ID:139430
 
obj
sword
icon = 'weapons.dmi'
icon_state = "s"
verb
Pick_Up()
set src in oview(1)
src.icon_state="s"
usr.contents += src
view() << "[usr] picks up [src]"
Equip()
if(usr.weapequip == 0)
usr.weapequip = 1
usr.overlays += "s"
view() << "[usr] wears [src]."
else
usr << "You are already wearing something else."
Unequip()
if(usr.weapequip == 1)
usr.weapequip = 0
usr.overlays -= "s"
view() << "[usr] removes [src]."
else
usr << "It isn't equipped"




Problem description:The equip and everything works, but the overlay dosnt. Whats wrong with this?

Does the player's icon have an icon state named "s"?
In addition to that, I don't believe you can add a text string to the overlays list and expect it to display the object. You will need to add an object to it.
In response to Garthor
No, the sword state is named "s". I did something wrong huh :?
In response to Iamtheparrot
If you are adding "s" to the overlays of an object, that is saying "add an overlay to object X, whose icon matches the icon of X, and whose icon state is 's'". If you wanted to add the icon of the sword, then you would add the sword itself, or some other object derived from the sword's icon.
In response to Garthor
I think thats what I was trying to do, idk. I just needed the sword icon state to be the one in the folder named "s", to be put on the same icon as the mob.

How would I do that?