So basically I have my helmet on a table. I have to where when you get 1 tile near it then a verb "Put_On" appears in a new Tab and you put the helmet on and it vanishes from the table. I have it set up so that there is a icon of the object on the table and the table without the object so basically when pressing the "Put_On" verb then it switches to the no object table and you have the helmet on your head. I don't know if it is the right way to do it, but it works perfectly for me. Now the problem is I have a "Take_Off" Verb and although that works perfectly as well. It always appear when the "Put_On" verb appears and I really don't know how to make it so that it only appears when you have the overlay on, most likely because I have it under the same obj line, but I don't know where else I would put it. Lastly when I press "Take_Off" it gives me a list and my name is in the list, when I confirm my name then the base icons deletes instead, but when I am one tile away from the table then the overlay of the helmet deletes and goes back to the table.
Code:
obj
HelmetOnTable
icon = 'Helmet.dmi'
icon_state = "HelmetOnTable"
density=1
verb
Put_On()
set src in view(1)
set category = "Helmet"
usr.overlays += /obj/overlay/Helmet
icon_state = "HelmetOffTable"
usr.verbs+=new/mob/Helmet/verb/Time_Travel()
usr.verbs+=new/obj/HelmetOnTable/verb/Take_Off()
verb
Take_Off()
set src in view(1)
set category = "Helmet"
icon_state = "HelmetOnTable"
usr.overlays-= /obj/overlay/Helmet
usr.verbs-=new/mob/Helmet/verb/Time_Travel()
"How do I make a verb appear when you are wearing a specific object?"
If that is in fact what you are asking, it involves using src settings properly.
Basically, what we're doing is creating an object in the user's contents and then tying the verbs to that object.
You really don't want object-specific verbs to be embedded on the mob. You want to use objects for that because the object is the one driving the behavior of the object, not the mob.