9
3

aMilitiaofficer55972.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Script Name : SpawnScripts/Freeport/aMilitiaofficer55972.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.04.29 07:04:22
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. movement_loop_start(NPC)
  10. end
  11. function movement_loop_start(NPC)
  12. MoveToLocation(NPC, 254.97, -4.73, 159.77, 2)
  13. MoveToLocation(NPC, 257.87, -3.88, 151.19, 2)
  14. MoveToLocation(NPC, 272.88, -3.78, 149.96, 2)
  15. MoveToLocation(NPC, 282.59, -3.86, 135.39, 2)
  16. MoveToLocation(NPC, 292.04, -3.88, 132.28, 2)
  17. MoveToLocation(NPC, 296.54, -4.40, 129.67, 2, "heading")
  18. end
  19. function heading(NPC)
  20. SetHeading(NPC, 312.53)
  21. AddTimer(NPC, 7000, "movement_loop_continue", 1)
  22. end
  23. function movement_loop_continue(NPC)
  24. MoveToLocation(NPC, 292.04, -3.88, 132.28, 2)
  25. MoveToLocation(NPC, 282.59, -3.86, 135.39, 2)
  26. MoveToLocation(NPC, 272.88, -3.78, 149.96, 2)
  27. MoveToLocation(NPC, 257.87, -3.88, 151.19, 2)
  28. MoveToLocation(NPC, 254.97, -4.73, 159.77, 2, "heading2")
  29. end
  30. function heading2(NPC)
  31. SetHeading(NPC, 189.11)
  32. AddTimer(NPC, 7000, "movement_loop_start", 1)
  33. end
  34. function hailed(NPC, Spawn)
  35. FaceTarget(NPC, Spawn)
  36. local choice = MakeRandomInt(1, 2)
  37. if choice == 1 then
  38. AddTimer(NPC, 7000, "movement_loop_start", 1)
  39. else
  40. AddTimer(NPC, 7000, "movement_loop_continue", 1)
  41. end
  42. end
  43. function respawn(NPC)
  44. spawn(NPC)
  45. end