ID:143982
 
Code:
src.verbs -= obj/NAME/verb/VERBNAME


Problem description:

Okay, I've been trying to remove a verb on an object with this piece of code but it doesn't seem to work. I tried messing with it too but either one of three things happen:

1. Compiles successfully but when I test it, the verb won't disappear.
2. Compiles with 1 or 2 warnings.
3. Fails to compile.

What's the problem?
Ok...For one...you put src.verbs...That basically means your trying to take a verb away from your character..But not sure if you can take it away from an object...But also not really sure what you mean...Lol...
Try
for(var/obj/NAME/verb/V in src.verbs)
if(V.type==/obj/NAME/verb/VERBNAME)
src.verbs.Remove(V)

I know it seems alot to remove one verb, but it should definitely work, alternatively, you could try
src.verbs.Remove(/obj/NAME/verb/VERBNAME)

But I'm not sure about that one
In response to Yamikaiba1236
lolololol

No it doesn't. If the procedure is defined under /obj, which it should be, then src will be the object that you call the procedure from.
That should work fine, assuming you've got everything set up correctly.
EX.
mob
proc

/* This proc, when added to a mobs verb list and used, will
add an object based verb to the mobs verb list, remove
itself from the verb list, and add a verb to remove the
newly added verb.
*/

AddVerb()
src.verbs += /obj/proc/ImAVerb
src.verbs += /mob/proc/RemoveVerb
src.verbs -= /mob/proc/AddVerb

/* Similarly, this verb removes the object based verb, and
removes itself, while adding the 'AddVerb' verb back to
the verb list.
*/

RemoveVerb()
src.verbs -= /obj/proc/ImAVerb
src.verbs -= /mob/proc/RemoveVerb
src.verbs += /mob/proc/AddVerb

/* When a player logs in, add the 'AddVerb' verb to their
verb list.
*/

Login()
..()
src.verbs += /mob/proc/AddVerb

/* This object is storing the verb you would like to add.
While it is listed as a proc, once added to the mobs
verb list it will behave exactly like a verb. I'm pretty
sure the only difference between a proc and a verb is
that procs are not automatically added to their
containing atom's verb list.
*/

obj
proc
ImAVerb()
world << "Hello!"


We need to see a bit more of your code to know what is wrong. The proc or verb where you are adding the other verb, and the object you are using to store the verb.