aMilitiaofficer55948.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --[[
  2. Script Name : SpawnScripts/Freeport/aMilitiaofficer55948.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.06 06:05:36
  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, -234.34, -56.06, 183.80, 2)
  13. MoveToLocation(NPC, -230.64, -56.06, 179.81, 2)
  14. MoveToLocation(NPC, -230.23, -56.06, 167.99, 2)
  15. MoveToLocation(NPC, -195.84, -57.01, 168.48, 2)
  16. MoveToLocation(NPC, -193.12, -57.39, 145.01, 2)
  17. MoveToLocation(NPC, -199.74, -56.94, 138.93, 2)
  18. MoveToLocation(NPC, -199.76, -56.84, 135.19, 2, "heading")
  19. end
  20. function heading(NPC)
  21. SetHeading(NPC, 27.88)
  22. AddTimer(NPC, "10000", "movement_loop_continue", 1)
  23. end
  24. function movement_loop_continue(NPC)
  25. MoveToLocation(NPC, -199.74, -56.94, 138.93, 2)
  26. MoveToLocation(NPC, -193.12, -57.39, 145.01, 2)
  27. MoveToLocation(NPC, -195.84, -57.01, 168.48, 2)
  28. MoveToLocation(NPC, -230.23, -56.06, 167.99, 2)
  29. MoveToLocation(NPC, -230.64, -56.06, 179.81, 2)
  30. MoveToLocation(NPC, -234.34, -56.06, 183.80, 2)
  31. MoveToLocation(NPC, -234.11, -56.06, 183.49, 2, "heading2")
  32. end
  33. function heading2(NPC)
  34. SetHeading(NPC, 92.92)
  35. AddTimer(NPC, 10000, "movement_loop_start", 1)
  36. end
  37. function hailed(NPC, Spawn)
  38. FaceTarget(NPC, Spawn)
  39. local choice = MakeRandomInt(1, 2)
  40. if choice == 1 then
  41. AddTimer(NPC, 10000, "movement_loop_start", 1)
  42. else
  43. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  44. end
  45. end
  46. function respawn(NPC)
  47. spawn(NPC)
  48. end