Cool_Colton

Anticheat

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