ID:145998
 
Code:
                if(M.client || M.alignment = "Heavenly") //If M is an actual player, respawn him
M.Move(locate(25,25,2))
M.hp = M.maxhp
M.mana = M.maxmana
M.energy = 100
M.overlays += /obj/angelwings
if(M.client || M.alignment = "Neutral") //If M is an actual player, respawn him
M.Move(locate(25,25,3))
M.hp = M.maxhp
M.mana = M.maxmana
M.energy = 100
M.overlays += /obj/halo
if(M.client || M.alignment = "Chaotic") //If M is an actual player, respawn him
M.Move(locate(25,25,4))
M.hp = M.maxhp
M.mana = M.maxmana
M.energy = 100
M.overlays += /obj/demonwings
else //If not, delete M and wait 2 seconds to repop the world
del(M)
spawn(200) world.Repop()


Problem description: Bad Assigment in the if(M.client || M.alignment..) code

If you want to check if something is equal to something else, you must have '==', instead of '='.
It appears this code is part of a DeathCheck() proc, in which case your proc is backwards. Notice how many times M appears in this proc. Obviously M is supposed to be the main focus of the proc, so this proc should belong to that mob. If this is a DeathCheck(), then the argument should be the killer, not the victim.

Also, it's probably not the best idea to call world.Repop() 20 seconds after each monster dies. In practice you'll end up with monsters respawning a lot more often as a result. If you want just this one monster to reappear, I suggest respawning it in some other way. You could, for example, move it to null and then move it back after 20 seconds (or better yet, a random delay).

Lummox JR
In response to Lummox JR
Lummox JR wrote:
It appears this code is part of a DeathCheck() proc
- Indeed it is.
in which case your proc is backwards. Notice how many times M appears in this proc. Obviously M is supposed to be the main focus of the proc, so this proc should belong to that mob. If this is a DeathCheck(), then the argument should be the killer, not the victim.
- Don't get what you mean here...
Also, it's probably not the best idea to call world.Repop() 20 seconds after each monster dies. In practice you'll end up with monsters respawning a lot more often as a result. If you want just this one monster to reappear, I suggest respawning it in some other way. You could, for example, move it to null and then move it back after 20 seconds (or better yet, a random delay).
- Done :)
In response to Mysame
Mysame wrote:
Lummox JR wrote:
It appears this code is part of a DeathCheck() proc
- Indeed it is.
in which case your proc is backwards. Notice how many times M appears in this proc. Obviously M is supposed to be the main focus of the proc, so this proc should belong to that mob. If this is a DeathCheck(), then the argument should be the killer, not the victim.
- Don't get what you mean here...

// wrong
mob/proc/DeathCheck(mob/victim)

// right
mob/proc/DeathCheck(mob/killer)


Lummox JR