ID:141280
 
Code:
mob
Login()
..()
world << "[src] has logged in."
src.icon = 'player.dmi'
src.HP = 100
src.MaxHP = 100
loc = locate(/turf/start)

var
HP
player //and player making sure your not an NPC meaning NPC wont attack each other
MaxHP

proc
DeathCheck() //check to see if an attack is deadly
if (HP <= 0) //if the defender's HP is low enough...
world << "[src] dies!" //give the death messaging
del(src)

verb
attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
usr << "You attack [M]!" //send this message to the usr
oview() << "[usr] attacks [M]!" //send this message to everybody else
var/damage = rand(1,10) //assign a random # to a new variable
world << "[damage] damage!" //tell the damage to the world
M.HP -= damage //take away the damage from M
M.DeathCheck() //check for death with a proc

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


// turf/door/verb/open()
// set src in view(1)

turf
floor
icon = 'floor.dmi'
luminosity = 0
wall
icon = 'wall.dmi'
density = 1
opacity = 1
start
icon = 'floor.dmi'
// door
// icon = 'door.dmi'
// closed
// icon_state = "closed"
// open
// icon_state = "open"
stairs
icon = 'stairs.dmi'
pitfall
icon = 'pitfall.dmi'
icon_state = "disguise"

turf/pitfall/Exit(atom/movable/a)
if(ismob(a))
var/mob/M=a
src.icon_state = "trap"
M << "You are stuck in [src]!"
view() << "[M] got stuck in a pitfall trap!"
else return ..()


mob/alien
icon='alien.dmi'
var/mob/P
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
if(P in oview(5)) //if a Player comes in 5 steps pf him
if(P.player)//no need to follow if mob aint a player
step_towards(src,P) //Chase him!
for(P in oview(1)) //here you can define some stuff
break //if you want your NPC to shoot make it so
for(P in oview(2)) //these are saying if the Player is within 1,2,3,4 blocks do nothing
break
for(P in oview(3))
break
for(P in oview(4))
break
else
step_rand(src) //if no NPC is 5 blocks or less away walk around
sleep(10) //stop for 1 second
for(P in oview(5)) //.......
break
else
step_rand(src) //if no NPC is 5 blocks or less away walk around
sleep(10) //stop for 1 second
for(P in oview(5)) //.......
break
Bump(mob/M)
if(M.player) //If the NPC bumps you
Fight(M)//Fight You!
else
return
sleep(5)
spawn(5)
Wander()//Wonder again...


proc/Fight(mob/M)
var/damage = rand(1,5)//you damage is a random number between 1 and 5
M.HP -= damage//this takes "damage" away from Health
M << "[src] attacks you for [damage] damage!!"//This tells "M" they have been attacked
src<<"You attack [M] for [damage] damage!!" //This tells you that you atttack M for how many damage
DeathCheck(M) // Run Death Check


Problem description:

Horror mazr.dm:99:error: proc definition not allowed inside another proc
Horror mazr.dme:20:error: unbalanced }


Anyone wanna help?
Please put it in tabs the code.

You've copy-pasted the code to the wrong place. The indentation is wrong. 'Bump' should be a few more to the left, and the code under it is just stuffed up.

I don't see a { or } anywhere in that code, but apparently you've got an unbalanced one on line 20. Try balancing it.

I really want to find out who wrote that 'Wander' proc and punch them in the face for it. It's just broken. Particularly your version of it, which has the indentation wrong, once again. Try reading the guide
In response to Jp
Its from a library.
by Coder4Hire
called NPC attack.

Can you give me a proper code please?
Bump Soz.