ID:176470
 
Im trying to create a code that checks if the Atom is equiped to the person, if it is it gets unequiped and the overlays go away and then it does as usual...Here's my code:

verb
Pickpocket(mob/M in oview(1))
if(M.contents.len)
var/atom/A = pick(M.contents)
if(A.wearing == 1)
M.overlays -= A
A.wearing = 0
usr.contents += A
usr << "You stole [A.name] from [M.name]!"
M << "[usr] stole [A.name] from you!"
else
usr.contents += A
usr << "You stole [A.name] from [M.name]!"
M << "[usr] stole [A.name] from you!"

Thanks in advance!

-Crio

P.S- I get the errors:

verbs.dm:6:error:A.wearing:undefined var
verbs.dm:8:error:A.wearing:undefined var

But i already defined what wearing is in the clothes...

var/atom/A = pick(M.contents)
if(A.wearing == 1)
P.S- I get the errors:

verbs.dm:6:error:A.wearing:undefined var
verbs.dm:8:error:A.wearing:undefined var

But i already defined what wearing is in the clothes...

You may have defined wearing in the clothes but A is an atom.