mob/proc
Death(mob/M)
if(src.type == /mob/player)// If a player dies
PlayerDie()
if(src.type == /mob/monster)// If a monster dies
Monsterdie()
// if(src.HP <=0)
PlayerDie(mob/M)//If the player dies.
if(src.HP <= 0)// if hp is smaller than 0
view() << "[src] died!"// In the view tells who died.
src.loc = locate(1,1,100)// Sends player to death screen.
sleep(30)
src.loc = locate(10,10,1)// Sends player to spawn point.
src.HP = MaxHP
src.Energy = MaxEnergy
src.locked=0
src.firing=0
Monsterdie(mob/M)
if(M.HP <= 0)
view() << "[src] was killed!"// In the view tells who died.
src.loc = locate(1,1,99)// sends NPC to NPC death screen.
src.locked=1
src.firing=1
sleep(1000)
src.loc = locate(50,50,1)// sends the NPC to its respawn point.
src.HP = src.MaxHP
src.Energy = src.MaxEnergy
src.locked=0
src.firing=0
mob/monster/Student
icon = 'Student.dmi'
icon_state = "NPC"
name = "Student"
monster=1
HP = 100
MaxHP = 100
Power = 10
Problem description: When a player attacks an NPC there HP does down but the Monsterdie() proc doesn't work. If anyone can help modify this code or just point me in the right direction i'd be grateful.