Ghaz-ranka

Untitled

Nov 15th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.84 KB | None | 0 0
  1. script("Player Join") {
  2. trigger("playerjoin")
  3. @broadcast(@player("name") + " has joined.")
  4. }
  5.  
  6. script("Timer Test") {
  7. trigger("timer")
  8. timer(1000000)
  9. @broadcast("&1Script Line " + script("line") + ": &f" + "timer Test")
  10. foreach(value in RespawningBlocks){
  11. @setblock(value, "minecraft:stone")
  12. @spawn(value, "zombie", 1)
  13. //@broadcast(@get("velocity", @spawn(value, "zombie", 1)))
  14. }
  15. }
  16.  
  17. script("Change Health Test") {
  18. trigger("ChangeHealth")
  19. @broadcast("&1Script Line " + script("line") + ": &f" + "Woop Woop Woop")
  20. }
  21.  
  22. script("Explosion Test") {
  23. trigger("explosion")
  24. @broadcast("&1Script Line " + script("line") + ": &f" + "You canceled an explosion")
  25. @cancel()
  26. }
  27.  
  28. script("Entity Interact Test") {
  29. trigger("interactEntity")
  30. @broadcast("&1Script Line " + script("line") + ": &f" + @player("name") + "interacted with " + @entity("type"))
  31. }
  32.  
  33. //script("Hunger Change Test") {
  34. // trigger("ChangeHunger")
  35. // @broadcast(@player("name") + " has joined.")
  36. //}
  37.  
  38. script("Entity Spawn") {
  39. var public blockedmobs = {"creeper", "enderman", "slime", "bullet", "xporb"}
  40. var public knownEntities = {"creeper", "enderman", "slime", "xporb", "skeleton", "item", "slime". "zombie"}
  41. trigger("entitySpawn")
  42. //@broadcast(string(@entity("type")))
  43. //@cancel()
  44. foreach(value in blockedmobs){
  45. //@broadcast(value + ", " + string(@entity("type")))
  46. if(value ~ string(@entity("type"))){
  47. //@broadcast(string(@entity("type")))
  48. @cancel()
  49. }
  50. }
  51. foreach(value in knownEntities){
  52. if(value !~ string(@entity("type"))){
  53. //@broadcast(string(@entity("type")))
  54. }
  55. }
  56. }
  57.  
  58.  
  59. script("Block Interact") {
  60. //var public debug = {"Script Line: " + script("line") + " " +}
  61. //var public testdebug = script("line")
  62. var public BannedItems = {"flansmod:gl6", "flansmod:mk2Frag", "flansmod:m67", "flansmod:rgd33", "flansmod:type97", "flansmod:gl1", "flansmod:c4"}
  63. var public BannedInventories = {"minecraft:crafting_table", "flansmod:german", "flansmod:japanese", "flansmod:american", "flansmod:modern", "flansmod:british", "flansmod:russian", "flansmod:modernAdvanced", "flansmod:flansWorkbench"}
  64. //var public LumberEXP = {"Ghaz_ranka" : {0}, "Hawk_eye0091" : {0}}
  65. //var public LumberLevel = {"Ghaz_ranka" : 0, "Hawk_eye0091" : 0}
  66. var blockinteractfired = false
  67. var local Zone1 = {895, -1280, 256, 0, 1023, -1152}
  68. trigger("interactBlock")
  69. //var parse @player("name") + "_test" + @block("id")= "test"
  70. //@send($(@player("name") + "_test" + @block("id")))
  71. //@broadcast(@get("item_lore", @player("hand", %"player"%)))
  72. @broadcast("&1Script Line " + script("line") + ": &f" + @block("id"))
  73. foreach(value in BannedInventories){
  74. if(value ~ @block("id")){
  75. if (%"Interaction"% ~ "right"){
  76. @cancel()
  77. @send("&1Script Line " + script("line") + ": &f" + "This inventory is blocked")
  78. }
  79. }
  80. }
  81. if (@vector("x", @entity("location")) < Zone1[1] and @vector("x", @entity("location")) > Zone1[2] and @vector("y", @entity("location")) < 256 and @vector("y", @entity("location")) > 0 and @vector("z", @entity("location")) < 1023 and @vector("z", @entity("location")) > -1152) {
  82. @broadcast ("&1Script Line " + script("line") + ": &f" + @player("name") + " is in Zone 1")
  83. foreach(value in BannedItems){
  84. if(@player("hand") !~ null and value ~ @item("id", @player("hand"))){
  85. @cancel()
  86. @send("This is a banned item in Zone 1")
  87. blockinteractfired = true
  88. break
  89. }
  90.  
  91. if (!blockinteractfired){
  92. if (%"Interaction"% ~ "right" and @player("hand") !~ null){
  93. @broadcast("&1Script Line " + script("line") + ": &f" + @player("name") + " interacted with a block while holding " + @item("id", @player("hand")))
  94. blockinteractfired = true
  95. break
  96. }
  97. if (%"Interaction"% ~ "left" and @item("id", @player("hand")) ~ "minecraft:stone_axe"){
  98. //@broadcast("Line62Test: Test")
  99. if (@block("id", %"from"%) ~ "minecraft:log"){
  100. //@send("test")
  101. blockinteractfired = true
  102. LumberEXP[@player("name")][1] = LumberEXP[@player("name")][1] + 1
  103. @send("You gained " + LumberEXP[@player("name")][1] + " Lumbering EXP")
  104. }
  105. }
  106. }
  107. }
  108. }
  109.  
  110. if (@vector("x", @entity("location")) > 895 or @vector("x", @entity("location")) < -1280 or @vector("y", @entity("location")) > 256 or @vector("y", @entity("location")) < 0 or @vector("z", @entity("location")) > 1023 or @vector("z", @entity("location")) < -1152) {
  111. if(!blockinteractfired){
  112.  
  113. @broadcast ("&1Script Line " + script("line") + ": &f" + @player("name") + " is not in Zone 1")
  114. blockinteractfired = true
  115. break
  116. }
  117. }
  118. }
  119.  
  120. script("Item Drop") {
  121. trigger("itemdrop")
  122. foreach(item in %"ItemStacks"%) {
  123. @broadcast("&1Script Line " + script("line") + ": &f" + @player("name") + " dropped " + @item("id", item))
  124. }
  125. }
  126. script("Block Break") {
  127. trigger("blockbreak")
  128. foreach (transaction in %"Transactions"%) {
  129. @broadcast(@vector("x", @transaction("before", transaction)))
  130. }
  131. @cancel()
  132. }
  133. script("Player Block Break") {
  134. var public unbreakableblocks = {"minecraft:bedrock"}
  135. //var public RespawningBlocks = {"world", 0, 0, 0}
  136. var fired = false
  137. trigger("playerblockbreak")
  138. //@broadcast("block break")
  139. //@cancel()
  140. RespawningBlocksNumber = size(RespawningBlocks) + 1
  141. RespawningBlocks[RespawningBlocksNumber] = @location("array", %"from"%)
  142. @broadcast(RespawningBlocks)
  143. var array = @location("array", @entity("location"))
  144. var x = array[2]
  145. var y = array[3]
  146. var z = array[4]
  147. if (x < 895 and x > -1280 and y < 256 and y > 0 and z < 1023 and z > -1152) {
  148. foreach(value in Admins){
  149. if(value ~ @player("name")){
  150. foreach(value in unbreakableblocks){
  151. if(value ~ @block("id", %"from"%)){
  152. //var blockname = @block("id")
  153. //set blockname = substring(id, find(id, ":") + 1)
  154. @send(@block("id") + " is banned")
  155.  
  156. @cancel()
  157. }
  158. if(value !~ @block("id")){
  159. //var blockname = @block("id")
  160. //set blockname = substring(id, find(id, ":") + 1)
  161. @broadcast("&1Script Line " + script("line") + ": &f" + @player("name") + " broke " + @block("id", %"from"%) + " at " + @location("string"))
  162. }
  163. }
  164. fired = true
  165. break
  166. }
  167. if(!fired){
  168. @send("You are not able to build here")
  169. @cancel()
  170. fired = true
  171. break
  172. }
  173.  
  174. }
  175. }
  176. }
  177.  
  178. script("Block Place") {
  179. var public bannedblocks = {"minecraft:tnt"}
  180. var fired = false
  181. trigger("playerblockplace")
  182. if (@vector("x", @entity("location")) < 895 and @vector("x", @entity("location")) > -1280 and @vector("y", @entity("location")) < 256 and @vector("y", @entity("location")) > 0 and @vector("z", @entity("location")) < 1023 and @vector("z", @entity("location")) > -1152) {
  183. foreach(value in Admins){
  184. if(value ~ @player("name")){
  185. foreach(value in bannedblocks){
  186. if(value ~ @block("id", %"to"%)){
  187. //var blockname = @block("id")
  188. //set blockname = substring(id, find(id, ":") + 1)
  189. @send(@block("id", %"to"%) + " is banned")
  190. //@cancel()
  191. }
  192. if(value !~ @block("id")){
  193. //var blockname = @block("id")
  194. //set blockname = substring(id, find(id, ":") + 1)
  195. @broadcast("&1Script Line " + script("line") + ": &f" + @player("name") + " placed " + @block("id", %"to"%) + " at " + @location("string"))
  196. }
  197. }
  198. fired = true
  199. break
  200. }
  201. if(!fired){
  202. @send("You are not able to build here")
  203. @cancel()
  204. fired = true
  205. break
  206. }
  207.  
  208. }
  209. }
  210. }
  211. //script("Player Death") {
  212. //trigger("death")
  213. //@broadcast("A player has died")
  214. //}
  215. script("Admin Command") {
  216. //var public Admins = {"Ghaz_ranka"}
  217. trigger("command")
  218. command("Admin")
  219. @cancel()
  220. var arguments = split(%"Arguments"%, " ")
  221. if (arguments[1] ~ "list"){
  222. @send("Admins: " + string(Admins))
  223. }
  224. foreach(value in Admins){
  225. if(value ~ @player("name")){
  226. var arguments = split(%"Arguments"%, " ")
  227. if (arguments[1] ~ "add"){
  228. Admins += arguments[2]
  229. @send("Admins: " + string(Admins))
  230. }
  231. if (arguments[1] ~ "remove"){
  232. remove(Admins, arguments[2])
  233. @send("Admins: " + string(Admins))
  234. }
  235. }
  236. }
  237. }
  238.  
  239. script("Moderator Command") {
  240. var public Moderators = {"Ghaz_ranka"}
  241. trigger("command")
  242. command("Moderator")
  243. @cancel()
  244. var arguments = split(%"Arguments"%, " ")
  245. if (arguments[1] ~ "list"){
  246. @send("&1Moderators: &f" + string(Moderators))
  247. }
  248. foreach(value in Admins){
  249. if(value ~ @player("name")){
  250. var arguments = split(%"Arguments"%, " ")
  251. if (arguments[1] ~ "add"){
  252. Moderators += arguments[2]
  253. @send("Moderators: " + string(Moderators))
  254. }
  255. if (arguments[1] ~ "remove"){
  256. remove(Moderators, arguments[2])
  257. @send("Moderators: " + string(Moderators))
  258. }
  259. }
  260. }
  261. }
  262.  
  263. script("Variable Editor Command") {
  264. trigger("command")
  265. command("variable")
  266. @cancel()
  267. var arguments = split(%"Arguments"%, " ")
  268. if (arguments[2] ~ "list"){
  269. @send("&1" + arguments[1] + ":&f " + string($(arguments[1])))
  270. }
  271. foreach(value in Admins){
  272. if(value ~ @player("name")){
  273. var arguments = split(%"Arguments"%, " ")
  274. if (arguments[2] ~ "add"){
  275. $(arguments[1]) += arguments[3]
  276. @send("Added: " + arguments[3])
  277. }
  278. if (arguments[2] ~ "remove"){
  279. remove($(arguments[1]), arguments[3])
  280. @send("Removed: " + string($(arguments[1])))
  281. }
  282. }
  283. }
  284. }
  285.  
  286. script("Array Editor Command") {
  287. trigger("command")
  288. command("Array")
  289. @cancel()
  290. var arguments = split(%"Arguments"%, " ")
  291. if (arguments[3] ~ "list"){
  292. @send("&1" + arguments[1] + ":&f " + string($(arguments[1])))
  293. }
  294. foreach(value in Admins){
  295. if(value ~ @player("name")){
  296. var arguments = split(%"Arguments"%, " ")
  297. if (arguments[3] ~ "add"){
  298. $(arguments[1]) += arguments[3]
  299. @send("Added: " + arguments[3])
  300. }
  301. if (arguments[3] ~ "remove"){
  302. removeIndex($(arguments[1]), arguments[2])
  303. @send("Removed: " + string($(arguments[1])))
  304. }
  305. }
  306. }
  307. }
Advertisement
Add Comment
Please, Sign In to add comment