Heres another BAS script
; guardAI.sqs
; by Nagual
; ***************************************************************************
_AI = _this select 0
_Type = _this select 1
_POS = [(getpos _AI select 0),(getpos _AI select 1),(getpos _AI select 2)]
; ***************************************************************************
?(_type == "static") : goto "static"
?(_type == "staticc") : goto "staticc"
?(_type == "guard") : goto "guard"
; ***************************************************************************
#static
_ai setBehaviour "safe"
_ai setCombatMode "yellow"
dostop _ai
_ai setUnitPos "up"
#knows
; hint format ["AI Knows : %1", _AI knowsAbout player]
?!alive _AI : exit
? _AI knowsAbout player < .5 : goto "knows0"
? _AI knowsAbout player > .5 && _AI knowsAbout player < .9 : goto "knows1"
? _AI knowsAbout player > .5 && _AI knowsAbout player < .9 : goto "knows1"
? _AI knowsAbout player > .9 && _AI knowsAbout player < 2 : goto "knows2"
? _AI knowsAbout player > 2 && _AI knowsAbout player < 2.9 : goto "knows3"
? _AI knowsAbout player > 3 && _AI knowsAbout player <= 4 : goto "knows4"
~6
goto "knows"
#knows0
~1
goto "knows"
#knows1
_AI domove _POS
~1
goto "knows"
#knows2
_AI dowatch getpos player
~4
goto "knows"
#knows3
_AI dotarget player
~4
goto "knows"
#knows4
; Alarm Raised
_AI dofire player
dostop _ai
~4
goto "knows"
; ***************************************************************************
#staticc
_ai setBehaviour "safe"
_ai setCombatMode "yellow"
dostop _ai
_ai setUnitPos "up"
_ai switchmove "crouch"
#knowsc
; hint format ["AI Knows : %1", _AI knowsAbout player]
?!alive _AI : exit
? _AI knowsAbout player < .5 : goto "knows0c"
? _AI knowsAbout player > .5 && _AI knowsAbout player < .9 : goto "knows1c"
? _AI knowsAbout player > .5 && _AI knowsAbout player < .9 : goto "knows1c"
? _AI knowsAbout player > .9 && _AI knowsAbout player < 2 : goto "knows2c"
? _AI knowsAbout player > 2 && _AI knowsAbout player < 2.9 : goto "knows3c"
? _AI knowsAbout player > 3 && _AI knowsAbout player <= 4 : goto "knows4c"
~6
goto "knowsc"
#knows0c
~1
goto "knowsc"
#knows1c
_AI dowatch getpos player
~1
goto "knowsc"
#knows2c
_AI dowatch getpos player
~4
goto "knowsc"
#knows3c
_AI dotarget player
~4
goto "knowsc"
#knows4c
; Alarm Raised
_AI dofire player
dostop _ai
~4
goto "knowsc"
; ***************************************************************************
#guard
_ai setBehaviour "safe"
_ai setCombatMode "yellow"
#knowsg
; Checking What AI knows
; hint format ["AI Knows : %1", _AI knowsAbout player]
?!alive _AI : exit
? _AI knowsAbout player < .5 : goto "knows0g"
? _AI knowsAbout player > .5 && _AI knowsAbout player < .9 : goto "knows1g"
? _AI knowsAbout player > .5 && _AI knowsAbout player < .9 : goto "knows1g"
? _AI knowsAbout player > .9 && _AI knowsAbout player < 2 : goto "knows2g"
? _AI knowsAbout player > 2 && _AI knowsAbout player < 2.9 : goto "knows3g"
? _AI knowsAbout player > 3 && _AI knowsAbout player <= 4 : goto "knows4g"
~6
goto "knowsg"
#knows0g
; Is Alert
; _AI say "rus6"
_AI domove _POS
~4
goto "knowsg"
#knows1g
; _AI say "rus6"
~4
goto "knowsg"
#knows2g
; _AI say "rus14"
_AI dowatch player
~4
goto "knowsg"
#knows3g
; _AI say "rus15"
_AI domove getpos player
_AI dotarget player
~4
goto "knowsg"
#knows4g
_AI domove getpos player
_AI dofire player
_AI setbehaviour "combat"
~4
goto "knowsg"