Cool_Colton

Anticheat

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