ID:178546
 
when u die i had it so u would log out.... but it changed it to this

mob
attack(mob/M as mob in oview(1))
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M.HP =- damage
M.DeathCheck()
mob/proc
DeathCheck()
if (HP <= 0)
usr.loc = locate(14,2,1)
world << "[src] dies!"
where would i put the usr.loc thing (if thats even right...)
because right now the person who attacked goes to those coordinates
change usr.loc = locate(coords) into:

src.loc = locate(coords)
Aleis wrote:
when u die i had it so u would log out.... but it changed it to this

mob
attack(mob/M as mob in oview(1))
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M.HP =- damage
M.DeathCheck()
mob/proc
DeathCheck(mob/M)
if (M.HP <= 0)
M.loc = locate(14,2,1)
world << "[M] dies!"

Edit: forgot to add mob/M at the top.
mob/proc
DeathCheck(mob/M as mob)
if (M.HP <= 0)
M.loc = locate(14,2,1)
world << "[M] dies!"


Thats what the DeathCheck() proc should be,then you should be fine.Also,look at my Attack System


-Kappa the Imp
In response to Kappa the Imp
it says that it has an indentation error when i do this.....
mob/proc
DeathCheck(mob/M as mob)
if (M.HP <= 0) // the error is here
M.loc = locate(14,2,1)
world << "[M] dies!"
about that

In response to Aleis
mob/proc/DeathCheck(mob/M)
if (M.HP <= 0)
M.loc = locate(14,2,1)
world << "[M] dies!"
In response to Aleis
Aleis wrote:
it says that it has an indentation error when i do this.....
mob/proc
DeathCheck(mob/M as mob)
if (M.HP <= 0) // the error is here
M.loc = locate(14,2,1)
world << "[M] dies!"
about that

mob/proc/DeathCheck(mob/M as mob)
if(M.HP <= 0) // the error is here
M.loc = locate(14,2,1)
world << "[M] dies!"
Change usr to src