ID:144413
 
Code:
mob/proc/lifekise()
if(src.life<=reqlife){src<<"You cannot do this";return}
src.life-=reqlife
src<<"Successful"
obj/attack/var/reqlife

obj/attack
reqlife=3
verb/Attack
set name="ATTACK!"
usr.lifekise()


Problem description:
i lose no life but i still get the message, know whats wrong?
What's the point of having the reqlife a blank var why not just have it = 3. also shouldnt it be mob/attack? just wondering.
~Grand~
You're calling a mob's proc and trying to access an attack objects reqlife var therein without having a reference to that object.

Instead, you could try passing a reference to the attack object into lifekise, like so...

mob/proc/lifekise(obj/attack/A)
if(src.life<=A.reqlife){src<<"You cannot do this";return}
src.life-=A.reqlife
src<<"Successful"


Also, the following line isn't needed.
obj/attack/var/reqlife


Instead, just declare reqlife a variable in the latter of the attack object definition's. You'll also notice that I passed in the object reference to lifekise() and added the set src = usr.contents line, which if my memory serves me right, should give the player the verb just so long as he has the attack object in his contents.

obj/attack
var/reqlife=3
verb/Attack
set src = usr.contents
set name="ATTACK!"
usr.lifekise(src)
In response to Prodigal Squirrel
that helps alot, thanks