9
3

afunctionalclockwork.lua 859 B

1234567891011121314151617181920212223242526272829303132333435
  1. --[[
  2. Script Name : SpawnScripts/TempleStreet2/afunctionalclockwork.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.08.16 04:08:07
  5. Script Purpose :
  6. :
  7. --]]
  8. local QUEST = 574
  9. function spawn(NPC)
  10. AddSpawnAccess(NPC, NPC)
  11. SetPlayerProximityFunction(NPC, 20, "SpawnAccess", "SpawnAccess")
  12. end
  13. function hailed(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function SpawnAccess(NPC, Spawn)
  20. if HasQuest(Spawn, QUEST) and GetQuestStep(Spawn, QUEST) == 5 then
  21. AddSpawnAccess(NPC, Spawn)
  22. SetFollowTarget(NPC, Spawn)
  23. SetSpeed(NPC, 9)
  24. ToggleFollow(NPC)
  25. else
  26. RemoveSpawnAccess(NPC, Spawn)
  27. end
  28. end