Cool_Colton

Anticheat

Jun 20th, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.92 KB | None | 0 0
  1. every 1 second in world "world":
  2. loop all players:
  3. if {%loop-player%.bypass} is false:
  4. if gamemode of loop-player is creative or spectator:
  5. else:
  6. set {_player} to loop-player
  7. #Z movement
  8. set {%loop-player%.z2} to loop-player's z-coord
  9. set {%loop-player%.z.move} to ({%loop-player%.z2} - {%loop-player%.z})
  10. set {%loop-player%.z} to loop-player's z-coord
  11.  
  12. #X movement
  13. set {%loop-player%.x2} to loop-player's x-coord
  14. set {%loop-player%.x.move} to ({%loop-player%.x2} - {%loop-player%.x})
  15. set {%loop-player%.x} to loop-player's x-coord
  16.  
  17. #Combine
  18. if {%loop-player%.z.move} is more than 0:
  19. if {%loop-player%.x.move} is more than 0:
  20. set {%loop-player%.move} to {%loop-player%.z.move} + {%loop-player%.x.move}
  21. if {%loop-player%.x.move} is less than 0:
  22. set {%loop-player%.move} to {%loop-player%.z.move} - {%loop-player%.x.move}
  23. if {%loop-player%.z.move} is less than 0:
  24. if {%loop-player%.x.move} is more than 0:
  25. set {%loop-player%.move} to {%loop-player%.x.move} - {%loop-player%.z.move}
  26. if {%loop-player%.x.move} is less than 0:
  27. set {%loop-player%.z.move} to {%loop-player%.z.move} * -1
  28. set {%loop-player%.move} to {%loop-player%.z.move} - {%loop-player%.x.move}
  29. if {%loop-player%.move.2} is the same as {%loop-player%.move}:
  30. set {%loop-player%.move} to 0
  31. set {%loop-player%.move.2} to {%loop-player%.move}
  32. if loop-player is swimming:
  33. else:
  34. if loop-player has speed:
  35. else:
  36.  
  37. #Cheat check
  38. if {%loop-player%.x.move} is less than 2:
  39. if {%loop-player%.x.move} is more than 0:
  40. if {%loop-player%.move} is more than 9:
  41. set {_player} to loop-player
  42. add 1 to {%loop-player%.illegal.move}
  43. if {%loop-player%.illegal.move} is more than 3:
  44. loop all players:
  45. if {%loop-player-2%.anticheat.message} is true:
  46. send "&eSpeed (by superx76)&7- %{_player}% &clikely has speed! &3Moved %{%loop-player-1%.move}% blocks in 1 second" to loop-player-2
  47. if {%loop-player%.illegal.move} is more than 8:
  48. execute console command "/tempban %loop-player% 30 -s DoggoCheat: You have been caught using speed hacks"
  49. set {%loop-player%.illegal.move} to 0
  50. set {%loop-player%.move} to 0
  51. wait 13 seconds
  52. remove 1 from {%loop-player%.illegal.move}
  53.  
  54.  
  55. if {%loop-player%.move} is less than -9:
  56. set {_player} to loop-player
  57. add 1 to {%loop-player%.illegal.move}
  58. if {%loop-player%.illegal.move} is more than 3:
  59. loop all players:
  60. if {%loop-player-2%.anticheat.message} is true:
  61. send "&eSpeed (by superx76)&7- %{_player}% &clikely has speed! &3Moved %{%loop-player-1%.move}% blocks in 1 second" to loop-player-2
  62. if {%loop-player%.illegal.move} is more than 8:
  63. execute console command "/tempban %loop-player% 30 -s DoggoCheat: You have been caught using speed hacks"
  64. wait 13 seconds
  65. remove 1 from {%loop-player%.illegal.move}
  66.  
  67. if {%loop-player%.x.move} is more than -2:
  68. if {%loop-player%.x.move} is less than 0:
  69. if {%loop-player%.move} is more than 9:
  70. set {_player} to loop-player
  71. add 1 to {%loop-player%.illegal.move}
  72. if {%loop-player%.illegal.move} is more than 3:
  73. loop all players:
  74. if {%loop-player-2%.anticheat.message} is true:
  75. send "&eSpeed (by superx76)&7- %{_player}% &clikely has speed! &3Moved %{%loop-player-1%.move}% blocks in 1 second" to loop-player-2
  76. if {%loop-player%.illegal.move} is more than 8:
  77. execute console command "/tempban %loop-player% 30 -s DoggoCheat: You have been caught using speed hacks"
  78. wait 13 seconds
  79. remove 1 from {%loop-player%.illegal.move}
  80.  
  81. if {%loop-player%.move} is less than -9:
  82. set {_player} to loop-player
  83. add 1 to {%loop-player%.illegal.move}
  84. if {%loop-player%.illegal.move} is more than 3:
  85. loop all players:
  86. if {%loop-player-2%.anticheat.message} is true:
  87. send "&eSpeed (by superx76)&7- %{_player}% &clikely has speed! &3Moved %{%loop-player-1%.move}% blocks in 1 second" to loop-player-2
  88. if {%loop-player%.illegal.move} is more than 8:
  89. execute console command "/tempban %loop-player% 30 DoggoCheat: You have been caught using speed hacks"
  90. wait 13 seconds
  91. remove 1 from {%loop-player%.illegal.move}
  92.  
  93. #Secondary Cheat Check
  94. if {%loop-player%.move} is more than 10.7:
  95. set {_player} to loop-player
  96. add 1 to {%loop-player%.illegal.move}
  97. if {%loop-player%.illegal.move} is more than 3:
  98. loop all players:
  99. if {%loop-player-2%.anticheat.message} is true:
  100. send "&eSpeed (by superx76)&7- %{_player}% &clikely has speed! &3Moved %{%loop-player-1%.move}% blocks in 1 second" to loop-player-2
  101. if {%loop-player%.illegal.move} is more than 8:
  102. execute console command "/tempban %loop-player% 30 DoggoCheat: You have been caught using speed hacks"
  103. wait 13 seconds
  104. remove 1 from {%loop-player%.illegal.move}
  105.  
  106.  
  107. #Reach anticheat
  108.  
  109. on damage:
  110. attacker is a player
  111. victim is a player
  112. if attacker is holding a bow:
  113. else:
  114. set {_attacker} to location of attacker
  115. set {_victim} to location of victim
  116. set {_distance} to the distance between {_victim} and {_attacker}
  117. if {_distance} is more than 4:
  118. add 1 to {%attacker%.illegal.reach}
  119. if {%attacker%.illegal.reach} is more than 8:
  120. execute console command "/tempban %attacker% 30 DoggoCheat: You have been caught using reach hacks"
  121. if {%attacker%.illegal.reach} is more than 3:
  122. loop all players:
  123. if {%loop-player%.anticheat.message} is true:
  124. send "&eReach (by superx76)&7- %attacker% &clikely has reach! &3Hit from %{_distance}% blocks away (Normal is 3.6)" to loop-player
  125. wait 20 seconds
  126. remove 1 from {%attacker%.illegal.reach}
  127.  
  128.  
  129.  
  130. #COMMANDSSSSS
  131.  
  132. on respawn:
  133. set {%player%.x} to 0
  134. set {%player%.x2} to 0
  135. set {%player%.z} to 0
  136. set {%player%.z2} to 0
  137.  
  138. every 5 seconds in world "world":
  139. loop all players:
  140. if {%loop-player%.bypass} is not set:
  141. set {%loop-player%.bypass} to false
  142.  
  143. command /sendanticheat:
  144. permission: Anticheat.message
  145. trigger:
  146. if {%player%.anticheat.message} is false:
  147. set {%player%.anticheat.message} to true
  148. send "Enabled anticheat messages"
  149. if {%player%.anticheat.message} is true:
  150. set {%player%.anticheat.message} to false
  151. send "Disabled anticheat messages"
  152.  
  153. command /bypass <player>:
  154. permission: Give.Bypass
  155. trigger:
  156. if {%arg 1%.bypass} is true:
  157. set {%arg 1%.bypass} to false
  158. send "I have removed %arg 1%'s bypass"
  159. else if {%arg 1%.bypass} is false:
  160. set {%arg 1%.bypass} to true
  161. send "I have given %arg 1% bypass"
  162.  
  163. on join:
  164. if {%player%.bypass} is not set:
  165. set {%player%.bypass} to false
  166. set {%player%.send} to true
Add Comment
Please, Sign In to add comment