Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. local config = {
  2. ["group"] = {"Druid", "Sorcer", "Knight"},
  3. ["amount"] = 3, -- amount of friends on screen to break function
  4. ["distance"] = 7, --default on screen
  5. }
  6.  
  7. GetDistanceFromPlayers = function (players, distance)
  8. local c = Self.GetSpectators()
  9. local count = 0
  10. for i = 1, #c do
  11. if c[i]:isPlayer() and c[i]:isOnScreen() and c[i]:DistanceFromSelf() <= distance then
  12. if table.find(players, c[i]:Name()) then
  13. count = count + 1
  14. end
  15. end
  16. end
  17. print(count)
  18. return count
  19. end
  20.  
  21. registerEventListener(WALKER_SELECTLABEL, "onLabel")
  22. function onLabel(label)
  23. local label = label:lower()
  24. if label == "waitmc" then
  25. if GetDistanceFromPlayers(config.group, config.distance) < config.amount then
  26. setWalkerEnabled(false)
  27. else
  28. setWalkerEnabled(true)
  29. end
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement