ID:1906648
 
(See the best response by Ter13.)
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()




Best response
I'm not sure if I understood what you are asking. But I think what you are asking is:

"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.

obj
HelmetOnTable
icon = 'Helmet.dmi'
icon_state = "HelmetOnTable"
density=1
verb
Put_On()
set src in view(1)
set category = "Helmet"
if(locate(/obj/HelmetItem) in usr)
usr << "You are already wearing a sweet helmet."
return
usr.overlays += /obj/overlay/Helmet
new/obj/HelmetItem(usr)
HelmetItem
icon = 'Helmet.dmi'
icon_state = "HelmetOffTable"
verb
Take_Off()
set src in usr
set category = "Helmet"
usr.overlays -= /obj/overlay/Helmet
loc = null

Time_Travel()
set src in usr
//do your time travel business here.


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.
Fun fact: for objs, verbs default to "set src in usr".
IT worked perfectly, but I wanted to have it to where when you time travel you lose the helmet and must find the new one. So basically I just had it where the helmet overlay is deleted, but when I use Time Travel with it, the tab "Helmet" and verb "Take_Off" is still there. and when I press "Take_Off" then the verb goes away.
In response to Dayvon64
Call Take_Off() inside Time_Travel().
Take_Off()
set src in usr
set category = "Helmet"
usr.overlays -= /obj/overlay/Helmet
usr.verbs-=new/mob/Helmet/verb/Travel()
loc = null

Time_Travel()
set src in usr
In response to Dayvon64
No.
then what?