trolling.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. msg("dev", "§bTrolling §rwurde geladen.");
  2. event.load("player_join_server");
  3. event.load("player_leave");
  4. h = 0; //Laufvariable/Index, zu welchem Spieler alle tped werden
  5. taktrate = 5; //in ms
  6. zeitbegrenzung = 0; //in sek. 0 = unbegrenzt
  7. if(zeitbegrenzung != 0) {
  8. sgoto(zeitbegrenzung * 20, "term");
  9. }
  10. //Liste anlegen
  11. list.new("names");
  12. list.add(names, "FinbarTheViking");
  13. list.add(names, "ImKillerKatze");
  14. size = list.getSize(names);
  15. //String-Namen in Player-Datentyp konvertieren
  16. list.new("names2");
  17. i = -1;
  18. while(inc("i") < size) {
  19. list.add(names2, read.player(list.getIndex(names, i)));
  20. }
  21. //Liste kopieren
  22. removeVar("names");
  23. list.new("names");
  24. i = -1;
  25. while(inc("i") < size) {
  26. list.add(names, list.getIndex(names2, i));
  27. }
  28. @loop
  29. try() {
  30. tpto = list.getIndex(names2, h++);
  31. if(h == size) {
  32. h = 0;
  33. }
  34. i = -1;
  35. while(inc("i") < size) {
  36. entity.teleport(list.getIndex(names, i), entity.getLocation(tpto));
  37. }
  38. } catch {
  39. nothing();
  40. }
  41. sgoto(taktrate, "loop");
  42. @wait
  43. wait();
  44. if(event == "player_join_server") {
  45. if(list.contains(names, player)) {
  46. list.add(names2, player);
  47. inc("size");
  48. }
  49. goto("wait");
  50. }
  51. if(event == "player_leave") {
  52. list.remove(names2, player);
  53. dec("size");
  54. goto("wait");
  55. }
  56. goto("wait");
  57. @term
  58. term();