aMilitiaguard303778.lua 749 B

123456789101112131415161718192021222324252627282930313233
  1. --[[
  2. Script Name : SpawnScripts/ScaleYard2/aMilitiaguard303778.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.28 07:08:21
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetPlayerProximityFunction(NPC, 50, "InRange", "InRange")
  10. SpawnSet(NPC, "visual_state", 11422)
  11. local choice = math.random(1,3)
  12. if choice == 1 then
  13. SpawnSet(NPC, "model_type", 103)
  14. elseif choice == 2 then
  15. SpawnSet(NPC, "model_type", 1574)
  16. else
  17. SpawnSet(NPC, "model_type", 1575)
  18. end
  19. end
  20. function hailed(NPC, Spawn)
  21. FaceTarget(NPC, Spawn)
  22. end
  23. function respawn(NPC)
  24. spawn(NPC)
  25. end
  26. function InRange(NPC, Spawn)
  27. PlayersLevel = GetLevel(Spawn)
  28. SpawnSet(NPC, "level", PlayersLevel)
  29. end