verb/Attack(mob/M in oview(1))
set category = "Battle"
var/damage = src.strength - M.defense
if(M.client)
M.health -= damage
src <<"You attack [M] for [damage]!"
M <<"You are being attacked by [src]!"
src.level_up()
M.death_check(src)
else
M.health -= damage
src <<"You attack [M] for [damage]!"
M <<"You are being attacked by [src]!"
var/random = rand(1,3)
if(random == 9)
src.exp += 11
if(random == 9)
src.exp += 15
if(random == 9)
src.exp ++
src.level_up()
M.death_check(src)
proc/move()//Now, this proc handles NPC movement
for(var/mob/M in oview())//loops over all mobs in view
if(get_step_away(src,M,3))//checks distance
if(!M.client)//Not a player
continue//continues through the loop
else//Player
walk_to(src,M,1,2)//Move to the person
else//4-or-more spaces away
continue
spawn(20) move()//loops the proc after 2 seconds
proc/attackplayer()//Handles attacking
for(var/mob/M in oview(1))//Within one space this time
if(get_step_away(src,M,1))
if(!M.client)
continue
else
src.attack(M)//Calls the attack proc
else
return..()
spawn(20) attackplayer()
New()//When created
attackplayer()//Calls the procs for it
move()
proc/attack(mob/M)
var/damage = rand(1,strength)
M.health -= damage
M <<"You are being attacked by [src]!"
src.exp += rand(5,10)
src.level_up()
M.death_check(src)
mob
proc
Check(mob/player/M)
if(usr.exp>=usr.maxexp)
usr.level_up()
Problem description:
there is no error but everything attack you and something i dont want to attack do and if u r standing next to someone they will attack u without meaning 2 and there is a mob thing before the verb attack