aMilitiaofficer55951.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Script Name : SpawnScripts/Freeport/aMilitiaofficer55951.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.04 09:05:30
  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, -198.19, -55.63, 28.98, 2)
  13. MoveToLocation(NPC, -200.78, -56.07, 30.34, 2)
  14. MoveToLocation(NPC, -201.04, -56.07, 103.15, 2)
  15. MoveToLocation(NPC, -245.27, -55.40, 104.74, 2)
  16. MoveToLocation(NPC, -251.90, -55.71, 91.48, 2)
  17. MoveToLocation(NPC, -256.39, -55.71, 88.65, 2, "heading")
  18. end
  19. function heading(NPC)
  20. SetHeading(NPC, 19.48)
  21. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  22. end
  23. function movement_loop_continue(NPC)
  24. MoveToLocation(NPC, -251.90, -55.71, 91.48, 2)
  25. MoveToLocation(NPC, -245.27, -55.40, 104.74, 2)
  26. MoveToLocation(NPC, -201.04, -56.07, 103.15, 2)
  27. MoveToLocation(NPC, -200.78, -56.07, 30.34, 2)
  28. MoveToLocation(NPC, -198.19, -55.63, 28.98, 2)
  29. MoveToLocation(NPC, -180.78, -56.69, 29.06, 2, "heading2")
  30. end
  31. function heading2(NPC)
  32. SetHeading(NPC, 234.89)
  33. AddTimer(NPC, 10000, "movement_loop_start", 1)
  34. end
  35. function hailed(NPC, Spawn)
  36. FaceTarget(NPC, Spawn)
  37. local choice = MakeRandomInt(1, 2)
  38. if choice == 1 then
  39. AddTimer(NPC, 10000, "movement_loop_start", 1)
  40. else
  41. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  42. end
  43. end
  44. function respawn(NPC)
  45. spawn(NPC)
  46. end