mob
proc
DeathCheck(mob/client/M)
M.loc=locate(7,18,1)
M.overlays = null
M.Health = 100
M.Days_Survived = 0
M.Hunger = 100
M.Thirst = 100
M.Poisoned= 0
M.Head = 0
M.Body = 0
M.Running = 0
M.Stamina = 50
M.Antidote = 0
world<<"<font color=red><b><big>[M] was killed by a [src]!"
DinoDeath(M)
mob
proc
DinoDeath(mob/client/M)
var/mob/dinosaur/TRex/rex
if(istype(rex))
world<<sound('Rex Roar.ogg')
Problem description: Feels pretty simple to do, but I can't figure it out. Basically, I want a dinosaur roar to coincide with the players death when its broadcast to the world.
Of course, each dinosaur has a different sound it would make across the world when it claims a victim.
I'm not getting any errors, I just can't figure it out.
This way you can define onDeath() whatever you want it will be specific to that type and its children:
The reason why it didn't work is because you never defined who the variable rex was set to. Also, look up istype(), it would have functioned if you did if(istype(src, /.../TRex))
But you could easily make it fit any mob to do anything upon death as with the example I have shown