enemy_loop()
while(src) // While we still exist
sleep(5) // Change this depending on how fast you want the enemy to move
for(var/mob/player/M in oview(3)) // If there is a player around 10 spaces...
src.target = M // It sets it to its target
if(get_dist(src,src.target)<3) // If we have a target..
// var/mob/Player/
step_towards(src,src.target)
else // If there isnt a Target....
walk(src,null)
Problem description:
ive tried multiple solutions to this
i just noticed something
all of my games that require a loop crashes
actually it freezes and i dont know another way around it
could you please help me
what is a loop that could be used for enemy
that will not freeze eventually
i ran a check on my games and they time out after around an hour
sometimes less