Advertisement
errur

Teleport

Sep 29th, 2016
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. HEALTH_NEEDED <- 50
  2.  
  3. _lastDest <- 0;
  4.  
  5. function Teleport(who, where)
  6. {
  7. who.SetOrigin(where.GetOrigin());
  8. }
  9.  
  10. function Think()
  11. {
  12. ent <- null;
  13. while((ent = Entities.FindByClassname(ent, "player")) != null)
  14. {
  15. if(ent.GetHealth() <= HEALTH_NEEDED)
  16. Teleport(ent, GetDestination());
  17. }
  18. }
  19.  
  20. function GetDestination()
  21. {
  22. ent <- EntityGroup[_lastDest];
  23.  
  24. if(_lastDest < EntityGroup.len())
  25. _lastDest += 1;
  26. else
  27. _lastDest = 0;
  28.  
  29. return ent;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement