Advertisement
Guest User

DayZ Minecraft Skript.

a guest
Apr 5th, 2013
1,525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.89 KB | None | 0 0
  1. #CONFIG
  2. options:
  3. servername: Gattcraft
  4. onlyDayZ: false
  5. dayzworldname: DayZWorld
  6. noanimals: true
  7. chestrespawntime: 2 minutes
  8. chestrespawnradius: 5 #The radius checked for a player when a chest is gonna respawn. If a player is in that radius the chest won't spawn
  9. chestrespawnmaxradius: 100
  10. playerrespawntime: 10 #In Seconds
  11. giantspawnchance: 1
  12. zombiesspawnaroundplayers: true
  13. zombiespawnaroundplayerradius: 50 #The area Skript will check around each in-game player to spawn a group of zombies
  14. superspeedzombie: 30
  15. superspeedzombiespeed: 6
  16.  
  17. on script load:
  18. broadcast "&cDayZ by Funnygatt&7 has been loaded"
  19. set {dayz.working} to true
  20.  
  21. #Default Player Related Things
  22. on join:
  23. if {dayz.running} is true:
  24. if {dayz.joined.%player%} isn't set:
  25. set {dayz.joined.%player%} to false
  26. if {dayz.joined.%player%} is false:
  27. message "&7Welcome to &c{@servername} %player%&7! This server is running &cDayZ for Skript by Funnygatt&7! To join the apocalypse use &c/dayz join"
  28. if {dayz.joined.%player%} is true:
  29. teleport player to {dayz.%player%.last.location}
  30. set the join message to "&c%player%&7 is back in the fight!"
  31. stop
  32.  
  33. command /dayz [<text = "help">]:
  34. permission: dayz.user
  35. trigger:
  36. if argument 1 is "join":
  37. if {dayz.joined.%player%} is false:
  38. clear the inventory of the player
  39. teleport player to {dayz.spawn1.location}
  40. set the gamemode of the player to adventure
  41. execute console command "/heal %player%"
  42. equip player with all leather armor
  43. add 1 wood sword to the player
  44. add 1 water bottle to the player
  45. add 1 eye of ender to the player
  46. add 1 steak to the player
  47. add 1 paper to the player
  48. set {dayz.joined.%player%} to true
  49. set {dayz.thirst.%player%} to 20
  50. execute console command "/pex user %player% group set DayZ"
  51. stop
  52. message "&cYou can't join the game, If your already in it ;)"
  53.  
  54. #Operator Commands
  55. command /dayza [<text = "help">] [<text = "">] [<text = "">]:
  56. aliases: dayzadmin, adminz, admindayz
  57. permission: dayz.admin
  58. trigger:
  59. if argument 1 is "help":
  60. message "&cNo help for you!"
  61. if argument 1 is "reload":
  62. make console execute command "/skript disable DayZ Main"
  63. if argument 2 is "all":
  64. make console execute command "/skript disable DayZ Thirst"
  65. make console execute command "/skript disable enable Thirst"
  66. make console execute command "/skript enable DayZ Main"
  67. if argument 1 is "use":
  68. if argument 2 is "thirst":
  69. argument 3 is "true":
  70. set {dayz.run.thirst} to true
  71. message "&cDayZ Thirst Handler &7has been &aEnabled! Players now have thirst levels!"
  72. make player execute command "/skript enable DayZ Thirst"
  73. stop
  74. argument 3 is "false":
  75. set {dayz.run.thirst} to false
  76. message "&cDayZ Thirst Handler &7has been &cDisabled!"
  77. make player execute command "/skript disable DayZ Thirst"
  78. stop
  79. if argument 1 is "set":
  80. if argument 2 is "needed":
  81. message "&7Positions needed for proper game start:"
  82. message "&7Required: &clobby, spawn1, spawn 2, spawn3, spawn4, spawn5, zspawn"
  83. message "&7Optional: &crespawn"
  84. stop
  85. if argument 2 is "zspawn":
  86. block below player is grass, cobblestone or any tall grass:
  87. set {dayz.zombiespawn.%block below player%.%location of block below player%} to true
  88. message "&7Zombie Spawn has been set to &c%block below player%, %location of block below player%"
  89. stop
  90. message "&cYou need to stand on Cobblestone, grass or tall grass to set a zombie spawn!"
  91. stop
  92. set {dayz.%argument 2%.location} to location of the player
  93. message "&7Set &c%argument 2%&7 to &c%location of the player%"
  94. if argument 1 is "running":
  95. if argument 2 is "":
  96. message "&a-----------------------------------------------------"
  97. message "&7Use &c/dayza running true&7 to start the apocalypse. Use &c/dayza running false &7to stop the madness!"
  98. message "&a-----------------------------------------------------"
  99. stop
  100. if argument 2 is "true":
  101. broadcast "&cDayZ &7has been &aenabled&7, Let the killing begin!"
  102. loop all players:
  103. if {dayz.joined.%loop-player%} isn't set:
  104. set {dayz.joined.%loop-player%} to false
  105. if {dayz.joined.%loop-player%} is false:
  106. message "&7Welcome to &c{@servername}, %loop-player%&7! This server is running &cDayZ for Skript by Funnygatt&7! To join the apocalypse use &c/dayz join" to the loop-player
  107. if {dayz.joined.%loop-player%} is true:
  108. teleport player to {dayz.%loop-player%.last.location}
  109. broadcast "&c%loop-player%&7 is back in the fight!"
  110. set {dayz.running} to true
  111. stop
  112. if argument 2 is "false":
  113. loop all players:
  114. set {dayz.running} to false
  115. if {@onlyDayZ} is false:
  116. loop-player is in world "{@dayzworldname}"
  117. set {dayz.%loop-player%.last.location} to location of the loop-player
  118. teleport loop-player to {dayz.lobby.location}
  119. message "&a-----------------------------------------------------"
  120. message "&7The Minecraft Gods have killed the Zombies! For now. Return to spawn and get some rest!" to the loop-player
  121. message "&a-----------------------------------------------------"
  122. execute console command "/pex user %loop-player% group set default"
  123. execute console command "/heal %loop-player%"
  124. stop
  125. if {@onlyDayZ} is true:
  126. loop-player is in world "{@dayzworldname}"
  127. set {dayz.%loop-player%.last.location} to location of the loop-player
  128. execute console command "/stop The battle has been won! For now..."
  129. stop
  130.  
  131. command /forcezombie:
  132. permission: dayz.forcezombie
  133. trigger:
  134. if {@zombiesspawnaroundplayers} is true:
  135. loop all players:
  136. loop blocks in radius {@zombiespawnaroundplayerradius} around the loop-player:
  137. if {dayz.zombiespawn.%loop-block%.%location of loop-block%} is true:
  138. chance of 70%:
  139. spawn 3 zombies above the loop-block
  140. stop
  141. chance of 60%:
  142. spawn 8 zombies above the loop-block
  143. stop
  144. chance of 30%:
  145. spawn 24 zombies above the loop-block
  146. stop
  147. else:
  148. spawn 2 zombies above the loop-block
  149. stop
  150.  
  151. command /forcerestock:
  152. permission: dayz.forcerestock
  153. trigger:
  154. broadcast "&7Chests are being restocked, Server might lag!"
  155. loop all players:
  156. loop blocks in radius {@chestrespawnmaxradius} around the loop-player:
  157. loop-block is a trapped chest:
  158. distance between loop-block and the loop-player is less than {@chestrespawnradius}:
  159. stop
  160. set the loop-block to a chest
  161. chance of 10%:
  162. add 1 paper to the loop-block
  163. chance of 40%:
  164. add 1 wooden sword to the loop-block
  165. chance of 20%:
  166. add 1 leather helmet to the loop-block
  167. chance of 10%:
  168. add 1 leather tunic to the loop-block
  169. chance of 20%:
  170. add 1 leather pants to the loop-block
  171. chance of 20%:
  172. add 1 leather boots to the loop-block
  173. chance of 30%:
  174. add 1 stone sword to the loop-block
  175. chance of 10%:
  176. add 1 bow to the loop-block
  177. chance of 5%:
  178. add 1 arrow to the loop-block
  179. chance of 40%:
  180. add 1 melon slice to the loop-block
  181. chance of 2%:
  182. add 1 gold helmet to the loop-block
  183. chance of 1%:
  184. add 1 gold plate to the loop-block
  185. chance of 2%:
  186. add 1 gold pants to the loop-block
  187. chance of 3%:
  188. add 1 gold boots to the loop-block
  189.  
  190. command /awesome:
  191. permission: dayz.admin
  192. trigger:
  193. clear the player's inventory
  194. equip player with all diamond armor of protection 10
  195. add 1 diamond sword of sharpness 10000 to the player
  196. add 1 bow of infinity 1 and power 1000 to the player
  197. add 1 arrow to the player
  198.  
  199. #Extras
  200.  
  201. on spawn:
  202. if {@noanimals} is true:
  203. event-entity isn't a zombie or a giant:
  204. cancel event
  205. spawn 1 zombie at the event-entity
  206. stop
  207. if {@noanimals} is false:
  208. event-entity isn't a zombie, giant, wolf, squid, pig, cow, sheep, ocelot or chicken:
  209. cancel event
  210. stop
  211. event-entity is a zombie:
  212. block below the zombie is grass, cobblestone or any tall grass:
  213. apply fire resistance 30 to the zombie for 100 hours
  214. apply speed 3 to the zombie for 100 hours
  215. apply resistance 1 to the zombie for 100 hours
  216. apply strength 1 to the zombie for 100 hours
  217. chance of {@superspeedzombie}%:
  218. apply speed {@superspeedzombiespeed} to the zombie for 100 hours
  219. stop
  220. cancel event
  221. stop
  222.  
  223. on break:
  224. event-world is "{@dayzworldname}":
  225. player is op:
  226. if {dayz.joined.%Player%} is true:
  227. cancel event
  228. stop
  229. stop
  230. cancel event
  231.  
  232. on leftclick on a chest:
  233. cancel event
  234. set the clicked block to air
  235. wait 1 second
  236. set the clicked block to a trapped chest
  237.  
  238. on rightclick on a chest:
  239. cancel event
  240. set the clicked block to air
  241. wait 1 second
  242. set the clicked block to a trapped chest
  243.  
  244. on rightclick with a eye of ender:
  245. cancel event
  246. message "&7Chat while holding the &cEyePhone&7 to talk to the entire server!"
  247.  
  248. on rightclick with a water bottle:
  249. wait 2 seconds
  250. player doesn't have any water bottles:
  251. player has 1 glass bottle:
  252. set {dayz.thirst.%player%} to 20
  253. message "&bAhhhh, Much better!"
  254. stop
  255.  
  256. on craft:
  257. if {dayz.joined.%player%} is true:
  258. cancel event
  259.  
  260. on death:
  261. victim is a zombie:
  262. add 1 to {dayz.zombiekills.%attacker%}
  263. message "&aYou've killed %{dayz.zombiekills.%attacker%}% zombies during this life!" to the attacker
  264. clear drops
  265. victim is a player:
  266. message "&cYou have DIED! Your kills this life: %{dayz.zombiekills.%victim%}%" to the victim
  267. set {dayz.zombiekills.%victim%} to 0
  268. set {dayz.joined.%player%} to false
  269. set {dayz.thirst.%player%} to 0
  270. attacker is a player:
  271. set the death message to "&c%victim% &7was killed by &c%attacker%"
  272. attacker isn't a player:
  273. set the death message to "&c%victim% &7was killed by a &c%attacker%"
  274. clear the victim's inventory
  275. victim is a giant:
  276. add 10 to {dayz.zombiekills.%attacker%}
  277. message "&aYou've killed %{dayz.zombiekills.%attacker%}% during this life!" to the attacker
  278. clear drops
  279.  
  280. every minute:
  281. if {dayz.running} is true:
  282. if {@zombiesspawnaroundplayers} is true:
  283. loop all players:
  284. loop blocks in radius {@zombiespawnaroundplayerradius} around the loop-player:
  285. if {dayz.zombiespawn.%loop-block%.%location of loop-block%} is true:
  286. chance of 70%:
  287. spawn 3 zombies above the loop-block
  288. stop
  289. chance of 60%:
  290. spawn 8 zombies above the loop-block
  291. stop
  292. chance of 30%:
  293. spawn 24 zombies above the loop-block
  294. stop
  295. else:
  296. spawn 2 zombies above the loop-block
  297. stop
  298.  
  299. every {@chestrespawntime}:
  300. if {dayz.running} is true:
  301. broadcast "&7Chests are being restocked, Server might lag!"
  302. loop all players:
  303. loop blocks in radius {@chestrespawnmaxradius} around the loop-player:
  304. loop-block is a chest:
  305. stop
  306. loop-block is a trapped chest:
  307. distance between loop-block and the loop-player is less than {@chestrespawnradius}:
  308. stop
  309. set the loop-block to a chest
  310. chance of 50%:
  311. add 1 paper to the loop-block
  312. chance of 60%:
  313. add 1 wooden sword to the loop-block
  314. chance of 50%:
  315. add 1 leather helmet to the loop-block
  316. chance of 30%:
  317. add 1 leather tunic to the loop-block
  318. chance of 40%:
  319. add 1 leather pants to the loop-block
  320. chance of 50%:
  321. add 1 leather boots to the loop-block
  322. chance of 30%:
  323. add 1 stone sword to the loop-block
  324. chance of 20%:
  325. add 1 bow to the loop-block
  326. chance of 10%:
  327. add 1 arrow to the loop-block
  328. chance of 40%:
  329. add 1 melon slice to the loop-block
  330. chance of 2%:
  331. add 1 gold helmet to the loop-block
  332. chance of 1%:
  333. add 1 gold plate to the loop-block
  334. chance of 2%:
  335. add 1 gold pants to the loop-block
  336. chance of 3%:
  337. add 1 gold boots to the loop-block
  338. broadcast "&7Chests have been restocked!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement