anaccusedcitizen.lua 890 B

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