motan1205

ANTI AFK

Nov 16th, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.55 KB | None | 0 0
  1. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  2. # Author: Hubert Theodore #
  3. # In Game Name: GoldySlime #
  4. # Skype: hubertheodore #
  5. # Skript: @AFKHolo # #
  6. # #
  7. # Feature: #
  8. # -Hologram #
  9. # -AFK with Reason #
  10. # -Sounds
  11. # -AFK Timer #
  12. # #
  13. # Plugins Needed: #
  14. # -Holographic Display #
  15. # -SkRayFall #
  16. # #
  17. # No Permission Needed for this command #
  18. # Commands: /afk [<reason>] #
  19. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  20.  
  21. variables:
  22.  
  23. #Auto timer for people if they are not moving in game (in second-1). Example 1 minutes(60 sec) -> 59
  24. afkmax= 59
  25. afk.%player%= false
  26. options:
  27.  
  28. logo: &7[&9AFK&7]
  29.  
  30. #Change this to change the message when AFK
  31. yafk: &2%player% &ais now AFK
  32.  
  33. #Change this to change the message when AFK
  34. ylafk: &2%loop-player% &ais now AFK
  35.  
  36. #Change this to change the message when finish AFK
  37. nafk: &2%player% &ais no more AFK
  38.  
  39. #Don't change this
  40. alsn: &7[&9 %arg 1% &7]
  41.  
  42. #Change this to change message when you call someone that afk
  43. safk: &4%loop-player% is still AFK, we will try to call with sounds.
  44.  
  45. # DON'T CHANGE ANYTHING BELOW THIS
  46. # AFK Command
  47.  
  48. command /afk [<text>]:
  49.  
  50. usage: /afk [<reason>]
  51. cooldown: 3 second
  52. trigger:
  53.  
  54. if {afk.%player%} is true:
  55. set {afk.%player%} to false
  56. broadcast "{@logo} {@nafk}"
  57. delete holo object "%player%.afk"
  58. stop
  59.  
  60. else:
  61. if argument 1 is not set:
  62. set {afk.%player%} to true
  63. broadcast "{@logo} {@yafk}"
  64. create holo object "ItemStack:BARRIER;&f&m--------&4A&cF&4K&f&m--------" with id "%player%.afk" at location 3.5 meters above player
  65. stop
  66.  
  67. else:
  68. set {afk.%player%} to true
  69. broadcast "{@logo} {@yafk} because {@alsn}"
  70. create holo object "ItemStack:BARRIER;&f&m--------&4A&cF&4K&f&m--------;{@alsn}" with id "%player%.afk" at location 3.5 meters above player
  71. stop
  72. on chat:
  73. if {afk.%player%} is true:
  74. set {afk.%player%} to false
  75. broadcast "{@logo} {@nafk}"
  76. delete holo object "%player%.afk"
  77. delete {afpl%player%}
  78.  
  79. on inventory click:
  80. if {afk.%player%} is true:
  81. set {afk.%player%} to false
  82. broadcast "{@logo} {@nafk}"
  83. delete holo object "%player%.afk"
  84. delete {afpl%player%}
  85.  
  86. on join:
  87. if {afk.%player%} is true:
  88. set {afk.%player%} to false
  89. broadcast "{@logo} {@nafk}"
  90. delete holo object "%player%.afk"
  91. delete {afpl%player%}
  92.  
  93. on quit:
  94. if {afk.%player%} is true:
  95. set {afk.%player%} to false
  96. broadcast "{@logo} {@nafk}"
  97. delete holo object "%player%.afk"
  98. delete {afpl%player%}
  99.  
  100. on place:
  101. if {afk.%player%} is true:
  102. set {afk.%player%} to false
  103. broadcast "{@logo} {@nafk}"
  104. delete holo object "%player%.afk"
  105. delete {afpl%player%}
  106.  
  107. on death:
  108. if {afk.%player%} is true:
  109. set {afk.%player%} to false
  110. broadcast "{@logo} {@nafk}"
  111. delete holo object "%player%.afk"
  112. delete {afpl%player%}
  113.  
  114. on command:
  115. if {afk.%player%} is true:
  116. set {afk.%player%} to false
  117. broadcast "{@logo} {@nafk}"
  118. delete holo object "%player%.afk"
  119. delete {afpl%player%}
  120.  
  121. on any move:
  122. if {afk.%player%} is true:
  123. loop all blocks in radius 2 around player:
  124. loop-block is water or piston or sticky_piston:
  125. stop
  126. loop all players in radius 2 around player:
  127. loop-player is not "%player%":
  128. stop
  129. loop all animals in radius 2 around player:
  130. loop-animal is set:
  131. stop
  132. set {afk.%player%} to false
  133. broadcast "{@logo} {@nafk}"
  134. delete holo object "%player%.afk"
  135. delete {afpl%player%}
  136.  
  137. on tool change:
  138. if {afk.%player%} is true:
  139. set {afk.%player%} to false
  140. broadcast "{@logo} {@nafk}"
  141. delete holo object "%player%.afk"
  142. delete {afpl%player%}
  143.  
  144. on teleport:
  145. if {afk.%player%} is true:
  146. set {afk.%player%} to false
  147. broadcast "{@logo} {@nafk}"
  148. delete holo object "%player%.afk"
  149. delete {afpl%player%}
  150.  
  151. on inventory open:
  152. if {afk.%player%} is true:
  153. set {afk.%player%} to false
  154. broadcast "{@logo} {@nafk}"
  155. delete holo object "%player%.afk"
  156. delete {afpl%player%}
  157.  
  158. on join:
  159. if {afk.%player%} is true:
  160. set {afk.%player%} to false
  161. broadcast "{@logo} {@nafk}"
  162. delete holo object "%player%.afk"
  163. delete {afpl%player%}
  164.  
  165. on death of player:
  166. if {afk.%victim%} is true:
  167. set {afk.%victim%} to false
  168. broadcast "{@logo} {@nafk}"
  169. delete holo object "%victim%.afk"
  170. delete {afpl%victim%}
  171.  
  172. on respawn:
  173. if {afk.%player%} is true:
  174. set {afk.%player%} to false
  175. broadcast "{@logo} {@nafk}"
  176. delete holo object "%player%.afk"
  177. delete {afpl%player%}
  178.  
  179. on chat:
  180. loop all players:
  181. if message contains "%loop-player%":
  182. if {afk.%loop-player%} is true:
  183. send "{@logo} {@safk}"
  184. #Sound is not working in 1.12.1
  185. play raw sound "note.bassattack" at loop-player with pitch 0 volume 1
  186. wait 1 seconds
  187. play raw sound "note.harp" at loop-player with pitch 0 volume 1
  188.  
  189.  
  190. every 1 seconds:
  191. loop all players:
  192. add 1 to {afpl%loop-player%}
  193. wait 1 tick
  194. if {afpl%loop-player%} is more than {afkmax}:
  195. if {afk.%loop-player%} is true:
  196. stop
  197. else:
  198. set {afk.%loop-player%} to true
  199. broadcast "{@logo} {@ylafk}"
  200. create holo object "ItemStack:BARRIER;&f&m--------&4A&cF&4K&f&m--------" with id "%loop-player%.afk" at location 3.5 meters above loop-player
  201. stop
Advertisement
Add Comment
Please, Sign In to add comment