ID:148160
 
ok whats wrong is that even when a human mob is beside the player it says the human mob isnt there so obviously im doing it wrong...heres the verb.

    verb/bite()
if(usr.attacking==0)
var/list/L = new
var/mob/Human/person/K
if(K in oview(1))
for(K in oview(1))
L+=K
var/mob/p = pick(L)
if(p.dead==1) return
spawn()
src.attacking=1
flick("bite",src)
var/k=rand(1,3)
src.hp+=k
src<<"<b>+[k]</b> hp"
src.attacking=0
if(src.hp>src.mhp)
src.hp=src.mhp
spawn()
p.attacking=1
flick("bite",p)
p.hp-=rand(1,8)
p.death()
p.attacking=0
view(10,src)<<'bite.wav'
else
src<<"No humans in view!"
K is null, and the list returned by oview doesn't contain null entries. Set K to "locate() in oview(1)" - you don't have to include the type path in the locate(), because K is defined as the correct type already (smart compiler, huh?). Then simply check to see if K is true. If it's false (null) then there are no human mobs in view.

<code>var/mob/Human/person/K=locate() in oview(1) if(K) //...and so on</code>
In response to Crispy (#1)
thank you Crispy that solved my problem!