ID:142804
 
Code:
obj                         
demons
verb
Soul_Capture(mob/M in oview(6))
set category = "Fighting"
if(M.npc == 1||M == usr||istype(M,/mob/monsters))
usr << "You cannot Soul Capture yourself or an NPC!"
else
if(usr.powerlevel >= 1)
view(10) << "[usr] captured [M]'s soul!"
M._GM_lockmove = 1
usr.capturing = 1
usr.powerlevel -=1
M.icon_state = "captured"
usr.contents += new/obj/weaken


weaken
verb
Weaken(mob/M in oview(1))
set category = "Fighting"
M.powerlevel -= 50
M.maxpowerlevel -= M.maxpowerlevel/2
M.die()
usr.capturing = 0
M._GM_lockmove = 0
view(10) << "[usr] gave back [M]'s soul!"
M.icon_state = ""
usr.contents -= new/obj/weaken


Problem description: I want the verb weaken to go away when i use it. can i have the appropriate code for that. right now the verb comes up when i soul capture someone, but it doesn't go away when i weaken().

That's because you are subtracting a new/obj/weaken from the contents list, when that instance is not in the contents list in the first place!

instead of this:

usr.contents -= new/obj/weaken


try this:

del src


This will actually delete the weaken object, removing the verb from the containing player. Seeing as you are adding a new /obj/weaken every time you use the soul capture technique, deleting the weaken object will change nothing, but remove your bug.

Cheers!
In response to Ter13
thnks alot im trying it now but it seems that when i replace usr.contents -= new/obj/weaken with del src i get a whole bunch of errors. like undefined variables and undefined type path
In response to Iraqii
sorry nvm i found another error lol. thnks for the code