well i did some lloking about and change some of the coding to suit mine so far but for some reson this does naothing where have i gone wrong ???
mob
proc
death(mob/M)
src << "You kill [src]!"
M << "You have been killed!"
M.loc = locate(rand(1,world.maxx),rand(1,world.maxy),rand(1,world.ma xz))
M.Health = initial(Health)
if(M.Health <= 0)
src.death(M)
ID:156180
![]() Dec 12 2010, 11:05 am (Edited on Dec 12 2010, 11:47 am)
|
|
![]() Dec 13 2010, 3:32 am
|
|
Not only are you handling your "death" proc all wrong, but you're also calling it recursively, which you NEVER want to do. You should check to see if the person dying's health is at or below 0 BEFORE going any further into such a proc.
|
mob
proc death(mob/M) if(M.Health <= 0) src << "You kill [src]!" M << "You have been killed!" M.loc = locate(rand(1,world.maxx),rand(1,world.maxy),rand(1,world.ma xz)) M.Health = initial(Health) You call the proc after each attack |
thxs i work it out a different way i relized that i had a bit of coding saying if health <= 0 Death then del src so it kept disconnecting me not but i got it all sorted
mob proc HurtMe(D) Health = Health - D if(Health <= 0) oview() << "[src] dies!" view() << "You died!" Health = MaxHealth/2 // one thing how do i stop this from going into decimals?????? src.loc=locate(1,-1,-1) sleep(30) src.loc = locate(/turf/Respawns/N1) |
oh right i used negtive one because i want to go on a balck screen for a coplue of second before they respawn
|