ID:262325
 
Code:
mob/verb
Attack()
set category="Combat"
flick(usr,"sparfury")
for(var/mob/M in oview(1))
if(M)
M.pl-=usr.str
else
usr.xp+=usr.str/2


Problem description:
The problem is, basically, nothing happens. I want to have it so that when nobody's there you train.
The for() list will loop through every instance of the type you specify (mob) in the list you give it (oview(1)). If no mobs are there, though, the loop will never be entered. Also, if multiple mobs are there the player would attack all of them. locate() will work nicely here. =)

mob/verb/Attack()
var/mob/defender = locate() in oview(1, src)
if(defender)
world << "[src] attacks [defender]."
else
world << "[src] works on his technique."
In response to YMIHere
well... i could of done that to o.O. lol maybe my mind is shutting down cause that code is pretty basic.