ID:139911
 
Code:
verb
attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = rand(1,10) //random number from 1 to 10
world << "[damage] damage!" //displays the amount of damage to the world
M.HP -= damage //removes the amount hit for hp from M
DeathCheck()
if (HP <= 0)
world << "[src] dies!"
del(src) //delete whatever just died

say(msg as text) //what the usr says is passed into "msg" as text
world << "[usr]: [msg]" //the world sees chatroom-like output


Problem description:

testworld.dm:32:error: proc definition not allowed inside another proc

Is my error.
I don't see it.


The lines after DeathCheck() shouldn't be indented. That or DeathCheck() should be undented(?) if you are defining the procedure there.
In response to Ulterior Motives
It worked, but I got this warning:

testworld.dm:32:warning: if: if statement has no effect
ugh..

I'm using the ZBT tutorial, btw.
Gonna assume you unindented the lines under if too. Should be:
DeathCheck()
if(HP <= 0)
world << "[src] dies!"
del src





In response to CockroachJr
Dude, check my reply. Same warning.
In response to Kid2255
I'm gonna assume that you either copied the code and pasted it incorrectly or your over or under spacing. Hitting tab would be the best option to indent. Procs should be defined under proc. Not in verbs/proc.
In response to RichardKW
I did neither of those.

Hmmm...
In response to Kid2255
If your using one spacing the next indent should be two, etc.
mob/proc/DeathCheck(var/mob/Killer)
if(src.HP <= 0)
world << "[src] dies! ([Killer] Killed Them)"
del src //delete whatever just died

mob/verb/Attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = rand(1,10) //random number from 1 to 10
world << "[damage] damage!" //displays the amount of damage to the world
M.HP -= damage //removes the amount hit for hp from M
M.DeathCheck(usr)