mob
verb
Attack(mob/M as mob in oview(1))
set hidden = 1
M.death_check()
usr.stamina()
usr.icon_state = "attack"
src.exp +=rand(2,1)
src.stamina -=rand(2,1)
sleep(4)
usr.icon_state = ""
src.Levelup()
sleep(15)
var/damage = M.strength
M.powerlevel -=damage
return
mob
verb
Rest()
set hidden = 1
usr.icon_state = "rest"
sleep(100)
usr.icon_state = ""
src.stamina = src.stamina_max
src.powerlevel=src.powerlevel_max
view() << "[src.name] has fully rested his strength"
return
client
command_text = ".alt "
mob/proc
KO()
if(src.powerlevel <= 5)
view() << "[src.name] has been knocked out!"
usr.icon_state = "KO"
src.KO = 1
mob
proc
Levelup()
if(src.exp>=src.tnl)//If your exp var equals, or passes your maxexp var
src.level++//Add to your level
src.exp=0//resets your exp to 0
src.tnl*=2//makes your maxexp double
src.strength+=rand(2,1)
src.defence+=rand(2,1)
src<<"You gained a level!"
world << "<small><font color = green><b>Level Info: <font color = blue>[src]/[key] has gained a level."
src.Statup()
else
..()
mob/proc/death_check(mob/M)
if(src.powerlevel <= 0)
usr. <<"You killed [src]!"
world << "<small><font color = red><b>Death Info: <font color = blue>[src]/[key] has been killed by [usr]."
if(src.client)
world << "<small><font color = red><b>Death Info: <font color = blue>[src]/[key] has been killed by [usr]."
src.loc = locate(23,1,2)
src.powerlevel = src.powerlevel_max
else
del(src)
Problem description:
i keep on getting runtime error when i kill someone ! the code above is the attack and the death check e/t/c i dont kno what that runritme error means can someone fix it for me please
runtime error: Cannot read null.strength
proc name: Attack (/mob/verb/Attack)
usr: Gebsbo (/mob)
src: Gebsbo (/mob)
call stack:
Gebsbo (/mob): Attack(null)
runtime error: Cannot read null.strength
proc name: Attack (/mob/verb/Attack)
usr: Gebsbo (/mob)
src: Gebsbo (/mob)
call stack:
Gebsbo (/mob): Attack(null)
Your code is all [didn't mommy teach you not to use dirty words?] up why do u have mob/M in death_check but your still using src? and also the error is happening on var/damage = M.strength, and also in the attack verb you are using M,usr,src.dont do that jeez<.< go back and read more of the dm guide.
~Grand~