Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #CONFIG
- options:
- servername: Gattcraft
- onlyDayZ: false
- dayzworldname: DayZWorld
- noanimals: true
- chestrespawntime: 2 minutes
- 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
- chestrespawnmaxradius: 100
- playerrespawntime: 10 #In Seconds
- giantspawnchance: 1
- zombiesspawnaroundplayers: true
- zombiespawnaroundplayerradius: 50 #The area Skript will check around each in-game player to spawn a group of zombies
- superspeedzombie: 30
- superspeedzombiespeed: 6
- on script load:
- broadcast "&cDayZ by Funnygatt&7 has been loaded"
- set {dayz.working} to true
- #Default Player Related Things
- on join:
- if {dayz.running} is true:
- if {dayz.joined.%player%} isn't set:
- set {dayz.joined.%player%} to false
- if {dayz.joined.%player%} is false:
- 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"
- if {dayz.joined.%player%} is true:
- teleport player to {dayz.%player%.last.location}
- set the join message to "&c%player%&7 is back in the fight!"
- stop
- command /dayz [<text = "help">]:
- permission: dayz.user
- trigger:
- if argument 1 is "join":
- if {dayz.joined.%player%} is false:
- clear the inventory of the player
- teleport player to {dayz.spawn1.location}
- set the gamemode of the player to adventure
- execute console command "/heal %player%"
- equip player with all leather armor
- add 1 wood sword to the player
- add 1 water bottle to the player
- add 1 eye of ender to the player
- add 1 steak to the player
- add 1 paper to the player
- set {dayz.joined.%player%} to true
- set {dayz.thirst.%player%} to 20
- execute console command "/pex user %player% group set DayZ"
- stop
- message "&cYou can't join the game, If your already in it ;)"
- #Operator Commands
- command /dayza [<text = "help">] [<text = "">] [<text = "">]:
- aliases: dayzadmin, adminz, admindayz
- permission: dayz.admin
- trigger:
- if argument 1 is "help":
- message "&cNo help for you!"
- if argument 1 is "reload":
- make console execute command "/skript disable DayZ Main"
- if argument 2 is "all":
- make console execute command "/skript disable DayZ Thirst"
- make console execute command "/skript disable enable Thirst"
- make console execute command "/skript enable DayZ Main"
- if argument 1 is "use":
- if argument 2 is "thirst":
- argument 3 is "true":
- set {dayz.run.thirst} to true
- message "&cDayZ Thirst Handler &7has been &aEnabled! Players now have thirst levels!"
- make player execute command "/skript enable DayZ Thirst"
- stop
- argument 3 is "false":
- set {dayz.run.thirst} to false
- message "&cDayZ Thirst Handler &7has been &cDisabled!"
- make player execute command "/skript disable DayZ Thirst"
- stop
- if argument 1 is "set":
- if argument 2 is "needed":
- message "&7Positions needed for proper game start:"
- message "&7Required: &clobby, spawn1, spawn 2, spawn3, spawn4, spawn5, zspawn"
- message "&7Optional: &crespawn"
- stop
- if argument 2 is "zspawn":
- block below player is grass, cobblestone or any tall grass:
- set {dayz.zombiespawn.%block below player%.%location of block below player%} to true
- message "&7Zombie Spawn has been set to &c%block below player%, %location of block below player%"
- stop
- message "&cYou need to stand on Cobblestone, grass or tall grass to set a zombie spawn!"
- stop
- set {dayz.%argument 2%.location} to location of the player
- message "&7Set &c%argument 2%&7 to &c%location of the player%"
- if argument 1 is "running":
- if argument 2 is "":
- message "&a-----------------------------------------------------"
- message "&7Use &c/dayza running true&7 to start the apocalypse. Use &c/dayza running false &7to stop the madness!"
- message "&a-----------------------------------------------------"
- stop
- if argument 2 is "true":
- broadcast "&cDayZ &7has been &aenabled&7, Let the killing begin!"
- loop all players:
- if {dayz.joined.%loop-player%} isn't set:
- set {dayz.joined.%loop-player%} to false
- if {dayz.joined.%loop-player%} is false:
- 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
- if {dayz.joined.%loop-player%} is true:
- teleport player to {dayz.%loop-player%.last.location}
- broadcast "&c%loop-player%&7 is back in the fight!"
- set {dayz.running} to true
- stop
- if argument 2 is "false":
- loop all players:
- set {dayz.running} to false
- if {@onlyDayZ} is false:
- loop-player is in world "{@dayzworldname}"
- set {dayz.%loop-player%.last.location} to location of the loop-player
- teleport loop-player to {dayz.lobby.location}
- message "&a-----------------------------------------------------"
- message "&7The Minecraft Gods have killed the Zombies! For now. Return to spawn and get some rest!" to the loop-player
- message "&a-----------------------------------------------------"
- execute console command "/pex user %loop-player% group set default"
- execute console command "/heal %loop-player%"
- stop
- if {@onlyDayZ} is true:
- loop-player is in world "{@dayzworldname}"
- set {dayz.%loop-player%.last.location} to location of the loop-player
- execute console command "/stop The battle has been won! For now..."
- stop
- command /forcezombie:
- permission: dayz.forcezombie
- trigger:
- if {@zombiesspawnaroundplayers} is true:
- loop all players:
- loop blocks in radius {@zombiespawnaroundplayerradius} around the loop-player:
- if {dayz.zombiespawn.%loop-block%.%location of loop-block%} is true:
- chance of 70%:
- spawn 3 zombies above the loop-block
- stop
- chance of 60%:
- spawn 8 zombies above the loop-block
- stop
- chance of 30%:
- spawn 24 zombies above the loop-block
- stop
- else:
- spawn 2 zombies above the loop-block
- stop
- command /forcerestock:
- permission: dayz.forcerestock
- trigger:
- broadcast "&7Chests are being restocked, Server might lag!"
- loop all players:
- loop blocks in radius {@chestrespawnmaxradius} around the loop-player:
- loop-block is a trapped chest:
- distance between loop-block and the loop-player is less than {@chestrespawnradius}:
- stop
- set the loop-block to a chest
- chance of 10%:
- add 1 paper to the loop-block
- chance of 40%:
- add 1 wooden sword to the loop-block
- chance of 20%:
- add 1 leather helmet to the loop-block
- chance of 10%:
- add 1 leather tunic to the loop-block
- chance of 20%:
- add 1 leather pants to the loop-block
- chance of 20%:
- add 1 leather boots to the loop-block
- chance of 30%:
- add 1 stone sword to the loop-block
- chance of 10%:
- add 1 bow to the loop-block
- chance of 5%:
- add 1 arrow to the loop-block
- chance of 40%:
- add 1 melon slice to the loop-block
- chance of 2%:
- add 1 gold helmet to the loop-block
- chance of 1%:
- add 1 gold plate to the loop-block
- chance of 2%:
- add 1 gold pants to the loop-block
- chance of 3%:
- add 1 gold boots to the loop-block
- command /awesome:
- permission: dayz.admin
- trigger:
- clear the player's inventory
- equip player with all diamond armor of protection 10
- add 1 diamond sword of sharpness 10000 to the player
- add 1 bow of infinity 1 and power 1000 to the player
- add 1 arrow to the player
- #Extras
- on spawn:
- if {@noanimals} is true:
- event-entity isn't a zombie or a giant:
- cancel event
- spawn 1 zombie at the event-entity
- stop
- if {@noanimals} is false:
- event-entity isn't a zombie, giant, wolf, squid, pig, cow, sheep, ocelot or chicken:
- cancel event
- stop
- event-entity is a zombie:
- block below the zombie is grass, cobblestone or any tall grass:
- apply fire resistance 30 to the zombie for 100 hours
- apply speed 3 to the zombie for 100 hours
- apply resistance 1 to the zombie for 100 hours
- apply strength 1 to the zombie for 100 hours
- chance of {@superspeedzombie}%:
- apply speed {@superspeedzombiespeed} to the zombie for 100 hours
- stop
- cancel event
- stop
- on break:
- event-world is "{@dayzworldname}":
- player is op:
- if {dayz.joined.%Player%} is true:
- cancel event
- stop
- stop
- cancel event
- on leftclick on a chest:
- cancel event
- set the clicked block to air
- wait 1 second
- set the clicked block to a trapped chest
- on rightclick on a chest:
- cancel event
- set the clicked block to air
- wait 1 second
- set the clicked block to a trapped chest
- on rightclick with a eye of ender:
- cancel event
- message "&7Chat while holding the &cEyePhone&7 to talk to the entire server!"
- on rightclick with a water bottle:
- wait 2 seconds
- player doesn't have any water bottles:
- player has 1 glass bottle:
- set {dayz.thirst.%player%} to 20
- message "&bAhhhh, Much better!"
- stop
- on craft:
- if {dayz.joined.%player%} is true:
- cancel event
- on death:
- victim is a zombie:
- add 1 to {dayz.zombiekills.%attacker%}
- message "&aYou've killed %{dayz.zombiekills.%attacker%}% zombies during this life!" to the attacker
- clear drops
- victim is a player:
- message "&cYou have DIED! Your kills this life: %{dayz.zombiekills.%victim%}%" to the victim
- set {dayz.zombiekills.%victim%} to 0
- set {dayz.joined.%player%} to false
- set {dayz.thirst.%player%} to 0
- attacker is a player:
- set the death message to "&c%victim% &7was killed by &c%attacker%"
- attacker isn't a player:
- set the death message to "&c%victim% &7was killed by a &c%attacker%"
- clear the victim's inventory
- victim is a giant:
- add 10 to {dayz.zombiekills.%attacker%}
- message "&aYou've killed %{dayz.zombiekills.%attacker%}% during this life!" to the attacker
- clear drops
- every minute:
- if {dayz.running} is true:
- if {@zombiesspawnaroundplayers} is true:
- loop all players:
- loop blocks in radius {@zombiespawnaroundplayerradius} around the loop-player:
- if {dayz.zombiespawn.%loop-block%.%location of loop-block%} is true:
- chance of 70%:
- spawn 3 zombies above the loop-block
- stop
- chance of 60%:
- spawn 8 zombies above the loop-block
- stop
- chance of 30%:
- spawn 24 zombies above the loop-block
- stop
- else:
- spawn 2 zombies above the loop-block
- stop
- every {@chestrespawntime}:
- if {dayz.running} is true:
- broadcast "&7Chests are being restocked, Server might lag!"
- loop all players:
- loop blocks in radius {@chestrespawnmaxradius} around the loop-player:
- loop-block is a chest:
- stop
- loop-block is a trapped chest:
- distance between loop-block and the loop-player is less than {@chestrespawnradius}:
- stop
- set the loop-block to a chest
- chance of 50%:
- add 1 paper to the loop-block
- chance of 60%:
- add 1 wooden sword to the loop-block
- chance of 50%:
- add 1 leather helmet to the loop-block
- chance of 30%:
- add 1 leather tunic to the loop-block
- chance of 40%:
- add 1 leather pants to the loop-block
- chance of 50%:
- add 1 leather boots to the loop-block
- chance of 30%:
- add 1 stone sword to the loop-block
- chance of 20%:
- add 1 bow to the loop-block
- chance of 10%:
- add 1 arrow to the loop-block
- chance of 40%:
- add 1 melon slice to the loop-block
- chance of 2%:
- add 1 gold helmet to the loop-block
- chance of 1%:
- add 1 gold plate to the loop-block
- chance of 2%:
- add 1 gold pants to the loop-block
- chance of 3%:
- add 1 gold boots to the loop-block
- broadcast "&7Chests have been restocked!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement