Well i know this is a long shot and ive been tring But can some one make it so if a mobs is attack they will attack back ?
Please hears my code....Thank you
mob/monsters/Bandit
HP = 40
icon = 'monsters.dmi'
icon_state = "bandit"
mouse_opacity = 2
Click()
if(get_dist(usr,src) <= 1)
usr.attack(src)
sleep(100)
else
...()
proc/move()
for(var/mob/M in oview())
if(get_step_away(src,M,1))
if(!M.client)
continue
else
walk_to(src,M,1,2)
else
continue
spawn(20)
move()
proc/attackplayer()
for(var/mob/M in oview(1))
if(get_step_away(src,M,1))
if(!M.client)
continue
else
src.attack(M)
else
return..()
spawn(20) attackplayer()
New()
attackplayer()
goldgiven = rand(5,10)
expgiven = rand(1,5)
move()
Copyright © 2024 BYOND Software.
All rights reserved.
In your attack(mob/M) proc, you should put the line M.attackplayer(src) somewhere. But only if it's not attacking, otherwise it will fall into an infinite loop. Maybe you should call attack() straght away instead of attackplayer? It depends on how your combat system is designed.
/Gazoot