9
3

aMilitiaguard303792.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --[[
  2. Script Name : SpawnScripts/ScaleYard2/aMilitiaguard303792.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.30 08:08:56
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetPlayerProximityFunction(NPC, 50, "InRange", "InRange")
  10. EmoteLoop (NPC)
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function EmoteLoop(NPC)
  19. local choice = math.random(1,3)
  20. local timer = math.random(2500,3500)
  21. if choice == 1 then
  22. PlayAnimation(NPC, 12214)
  23. AddTimer(NPC, timer, "EmoteLoop")
  24. elseif choice == 2 then
  25. PlayAnimation(NPC, 12187)
  26. AddTimer(NPC, timer, "EmoteLoop")
  27. elseif choice == 3 then
  28. PlayAnimation(NPC, 12329)
  29. AddTimer(NPC, timer, "EmoteLoop")
  30. else
  31. PlayAnimation(NPC, 11285)
  32. AddTimer(NPC, timer, "EmoteLoop")
  33. end
  34. end
  35. function InRange(NPC, Spawn)
  36. PlayersLevel = GetLevel(Spawn)
  37. SpawnSet(NPC, "level", PlayersLevel)
  38. end