When i click my attack verb in the game i get this error:
runtime error: Cannot read null.def
proc name: Attack (/mob/verb/Attack)
source file: Mobs.dm,145
usr: \[Master GM]Wanabe (/mob/Player)
src: \[Master GM]Wanabe (/mob/Player)
call stack:
\[Master GM]Wanabe (/mob/Player): Attack(null)
runtime error: Cannot execute null.DeathCheck().
proc name: Attack (/mob/verb/Attack)
source file: Mobs.dm,152
usr: \[Master GM]Wanabe (/mob/Player)
src: \[Master GM]Wanabe (/mob/Player)
call stack:
\[Master GM]Wanabe (/mob/Player): Attack(null)
I know what it says cannot read null. thingamigig's but i cant stop it, heres the verbs code, any help?..
mob/verb/Attack(mob/m as mob in oview(1)) set category = "Fighting" var/hitpercent=50+src.dex var/hitpercent2=hitpercent-m.Agility if(hitpercent2>100) hitpercent2=100 if(hitpercent2<0) hitpercent=0 var/hitpercent3=rand(1,100) sleep(2) src.Attack=1 if(hitpercent3 <= hitpercent2) if(src.Attack==1) var/damage = rand (src.str,src.str*2) damage -= rand(m.def,m.def*2) m.attacked = 1 if(damage > 0) m << "[src] attacks you and does [damage] damage" src << "You attack [m] for [damage] damage" m.hp-=damage src.Levelup() m.DeathCheck() sleep(5) src.Attack=1 else m << "[usr]'s attack bounces off of you!" src << "Your attack bounces off of [m]!" src.Levelup() m.DeathCheck() sleep(5) src.Attack=1 else return else src<<"You missed!" sleep(5) src.Attack=1
|
-Thanks
The first thing to do in your verb is this:
Lummox JR