aprisonescapee.lua 880 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --[[
  2. Script Name : SpawnScripts/ScaleYard2/aprisonescapee.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.29 07:08:54
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. SetPlayerProximityFunction(NPC, 20, "InRange", "LeaveRange")
  10. local choice = math.random(1,4)
  11. if choice == 1 then
  12. SpawnSet(NPC, "model_type", 116)
  13. elseif choice == 2 then
  14. SpawnSet(NPC, "model_type", 115)
  15. elseif choice == 3 then
  16. SpawnSet(NPC, "model_type", 105)
  17. elseif choice == 4 then
  18. SpawnSet(NPC, "model_type", 123)
  19. else
  20. SpawnSet(NPC, "model_type", 135)
  21. end
  22. end
  23. function hailed(NPC, Spawn)
  24. FaceTarget(NPC, Spawn)
  25. end
  26. function respawn(NPC)
  27. spawn(NPC, Spawn)
  28. end
  29. function InRange(NPC, Spawn)
  30. local PlayersLevel = GetLevel(Spawn)
  31. SpawnSet(NPC, "level", PlayersLevel)
  32. end
  33. function LeaveRange(NPC, Spawn)
  34. end