Jump to content

aifollow help


rizzen

Recommended Posts

well i just started scripting a few days ago and i have been playin around with this script which makes the npc "guard" follow the player when the player is sneaking and wander when he isnt. i have gotten it to work except for one small detail when i sneak the guard just turns and faces me and stays still until i stop sneaking in which case he goes back to wandering so i was wondering if anyone could take a look at my script and tell me what i did wrong thanks

 

Begin guard_sneak_follow

 

Short GuardWander

 

If ( GuardWander == 0 )

AiWander, 512, 0, 0,

Set GuardWander To 1

EndIf

 

 

If ( GetPCSneaking == 1 )

If ( GetLOS, player == 1 )

AiFollow, player, 0, 0, 0, 0,

EndIf

EndIf

 

If ( GetPCSneaking == 0 )

If ( GetCurrentAIPackage == 3 )

Set GuardWander To 0

EndIf

EndIf

 

End

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...