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....