aTunarianscout1.lua 761 B

12345678910111213141516171819202122232425262728
  1. --[[
  2. Script Name : SpawnScripts/OutpostOverlord/aTunarianscout1.lua
  3. Script Purpose : When player enters 20m proximity, scout Crouches
  4. Script Author : John Adams
  5. Script Date : 2009.01.08
  6. Script Notes : JA: may need to adjust range
  7. --]]
  8. local a_Tunarian_scout = 2780067
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 30, "InRange", "LeaveRange")
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function InRange(NPC, Player)
  16. FaceTarget(NPC, Player)
  17. DuckSpawn = GetSpawn(NPC, a_Tunarian_scout) -- Get Tunarian Scout
  18. SpawnSet(DuckSpawn, "visual_state", "221") -- Start crouch_idle
  19. end
  20. function LeaveRange(NPC, Player)
  21. DuckSpawn = GetSpawn(NPC, a_Tunarian_scout) -- Get Tunarian Scout
  22. SpawnSet(DuckSpawn, "visual_state", "0") -- Stop crouch_idle
  23. end