mob/Blueteam
Blueteam
name = "Blueteam"
icon = 'npc.dmi'
icon_state="Blueteam"
Health = 25
Mhealth = 25
team = "Blueteam"
var/mob/Redteam/RT
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
if(RT in oview(5)) //if a Player comes in 5 steps pf him
step_towards(src,RT ) //Chase him!
for(RT in oview(1))
break
for(RT in oview(2))
break
for(RT in oview(3))
break
for(RT 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(RT in oview(5)) //.......
break
sleep(5)
spawn(5)
Wander()//Wonder again...
Bump(mob/M)
if(M.team == "Redteam") //If the NPC bumps you
Fight(M)//Fight You!
else
Wander()
How do i make this npc stay in 1tile (not moving) but if a RedTeam player comes 5steps or less to this npc, it chases him. but if the RedTeam player got away, this npc teleports back to the same spot the creator put him in the map.
But if a BlueTeam comes 5steps or less to this npc, nothing happens(this npc doesn't move, it just stays in that spot til a RedTeam player comes)
//---
sorry if this is insulting but this is like one of those British guards