ID:145173
 
Code:
        Attack(mob/M in oview(1))
var/attacktype = pick("Punch","Kick")
if(usr.rest == 0 && usr.Stamina >= 5 && usr.attacking == 0)
usr.attacking = 1
if(usr.attacktype == "Punch")
var/pdamage = max(1, usr.Armstr - M.Endurance)
usr<<"You punch [M] for [pdamage] damage"
usr.Stamina -= rand(2,4)
M.HP -= pdamage
spawn(20 - usr.Speed)
usr.attacking = 0
if(usr.attacktype == "Kick")
var/kdamage = max(1, usr.Legstr - M.Endurance)
usr<<"You punch [M] for [kdamage] damage"
usr.Stamina -= rand(2,6)
M.HP -= kdamage
spawn(20 - usr.Speed)
usr.attacking = 0


Problem description:

Training.dm:17:error:usr.attacktype:undefined var
Training.dm:24:error:usr.attacktype:undefined var
Training.dm:14:attacktype :warning: variable defined but not used

I want it to pick Punch or Kick randomly and then use the one picked....
CYN, Add my msn, [email protected], so if u have any code problems, you have help just a click away, And ill help you with anything you need.
In response to Vancegetto
You're making a global var, not a mob one.