ID:148223
 
Wut this is supposed to do is when i click Attack close to a npc then it attacks but for ome reason after the list comes up and i lick attack it stops it dosent call back up the list

    verb
Attack(mob/M in oview(1))
set category = "Fighting"
switch(input("Attack Or Flee?","What would you like to do!",text) in list ("Attack","Flee"))
if("Attack")
if(M.npc == 0)
var/dam = rand(5,usr.str)

dam -= rand(1,M.def)
if (dam > 0)
M.hp -= dam
view(6) << "[usr] attacks [M] for [dam] health!"
else
view(6) << "[usr] attacks [M] but MISSES!"

if (M.hp <= 0)
die(M)
else
usr << "You can't hit npc's!"
return

verb
Attack(mob/M in oview(1))
set category = "Fighting"
var/a = input("What is your battle tactic?")in list("Attack","Flee?")
if(a=="Attack")
if(M.npc == 0)
var/dam = rand(5,usr.str)

dam -= rand(1,M.def)
if (dam > 0)
M.hp -= dam
view(6) << "[usr] attacks [M] for [dam] health!"
else
view(6) << "[usr] attacks [M] but MISSES!"

if (M.hp <= 0)
die(M)
else
usr << "You can't hit npc's!"
return


ah yes, and for the Flee, just put, if(a=="Flee")
In response to Buzzyboy
it dosent work it tell me that its a invalid expression
In response to Buzzyboy
Completely wrong, Buzzyboy. That won't help at all.

Cloud, I suggest you undo Buzzyboy's changes. They're going backwards. =)

Just from glancing at that code I can't see what's wrong, but I do know that Buzzyboy hasn't correctly identified the problem.