So this skript adding items back to player inventory? I looked though it but never found out why.
code_language.skript:
# ____ _ _ ____ _____ _____
# | _ \ | | | | / ___| |_ _| |__ /
# | |_) | | | | | \___ \ | | / /
# | _ < | |_| | ___) | | | / /_
# |_| \_\ \___/ |____/ |_| /____|
#
#Author: YoshYz
options:
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# OPTIONS #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
version: pre.0.6 Stable
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# FUNCTIONS #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
function craftingPanel(p: player):
open chest with 5 rows named "%{rconfig::panel_crafting_title}%" to {_p}
loop 54 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
loop 3 times:
set slot 23 of {_p}'s current inventory to Air named " "
set slot 21 of {_p}'s current inventory to Orange Stained Glass Pane named " "
wait 2 ticks
set slot 21 of {_p}'s current inventory to Air named " "
set slot 22 of {_p}'s current inventory to Orange Stained Glass Pane named " "
wait 2 ticks
set slot 22 of {_p}'s current inventory to Air named " "
set slot 23 of {_p}'s current inventory to Orange Stained Glass Pane named " "
wait 2 ticks
set slot 21 of {_p}'s current inventory to Air named " "
set slot 22 of {_p}'s current inventory to Air named " "
set slot 23 of {_p}'s current inventory to Air named " "
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# CONFIG #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
function createConfig():
message "&8&l&m---------------------------------------------" to the console
message "&aRustZ&8:&7 &8By &9YoshYz &6v{@version}" to the console
message "&aRustZ&8:&7 Checking folders..." to the console
#Config.yml
set {_prefix} to yaml value "Prefix" from file "plugins/RustZ/Config.yml"
if {_prefix} isn't set:
message "&aRustZ&8:&7 Config.yml &cnot found&7, creating it." to the console
set yaml value "Prefix" from file "plugins/RustZ/Config.yml" to " &aRustZ&8:&7"
set yaml value "World" from file "plugins/RustZ/Config.yml" to "world"
set yaml value "Join.X-max" from file "plugins/RustZ/Config.yml" to ("600" parsed as number)
set yaml value "Join.X-min" from file "plugins/RustZ/Config.yml" to ("300" parsed as number)
set yaml value "Join.Z-max" from file "plugins/RustZ/Config.yml" to ("600" parsed as number)
set yaml value "Join.Z-min" from file "plugins/RustZ/Config.yml" to ("300" parsed as number)
set yaml value "Scoreboard.Status" from file "plugins/RustZ/Config.yml" to "True"
set yaml value "Scoreboard.Update" from file "plugins/RustZ/Config.yml" to "10 seconds"
set yaml value "Blocks.Max.Planks" from file "plugins/RustZ/Config.yml" to ("50" parsed as number)
set yaml value "Blocks.Max.Ironblocks" from file "plugins/RustZ/Config.yml" to ("12" parsed as number)
set yaml value "Map.Regen.Cobblestone" from file "plugins/RustZ/Config.yml" to "30 seconds"
set yaml value "Map.Regen.Coalore" from file "plugins/RustZ/Config.yml" to "2 minutes"
set yaml value "Map.Regen.Ironore" from file "plugins/RustZ/Config.yml" to "5 minutes"
set yaml value "Map.Regen.Wood" from file "plugins/RustZ/Config.yml" to "30 seconds"
set yaml value "Map.Regen.Leaves" from file "plugins/RustZ/Config.yml" to "30 seconds"
set yaml value "Map.Regen.Long_grass" from file "plugins/RustZ/Config.yml" to "10 seconds"
set yaml value "Map.Torch.Extinguish" from file "plugins/RustZ/Config.yml" to "30 minutes"
set yaml value "Map.Torch.Shut_off" from file "plugins/RustZ/Config.yml" to "2 minutes"
#Scoreboard.yml
set {_scoreboard.title} to yaml value "Scoreboard.Title" from file "plugins/RustZ/Scoreboard.yml"
if {_scoreboard.title} isn't set:
message "&aRustZ&8:&7 Scoreboard.yml &cnot found&7, creating it." to the console
set yaml value "Scoreboard.Title" from file "plugins/RustZ/Scoreboard.yml" to "&a&lRustZ"
set yaml value "Scoreboard.Line-1" from file "plugins/RustZ/Scoreboard.yml" to "&1"
set yaml value "Scoreboard.Line-2" from file "plugins/RustZ/Scoreboard.yml" to "&8» &9Profile"
set yaml value "Scoreboard.Line-3" from file "plugins/RustZ/Scoreboard.yml" to "&aKills&8:"
set yaml value "Scoreboard.Line-4" from file "plugins/RustZ/Scoreboard.yml" to "&aDeaths&8:"
set yaml value "Scoreboard.Line-5" from file "plugins/RustZ/Scoreboard.yml" to "&aFarming&8:"
set yaml value "Scoreboard.Line-6" from file "plugins/RustZ/Scoreboard.yml" to "&2"
set yaml value "Scoreboard.Line-7" from file "plugins/RustZ/Scoreboard.yml" to "&aLevel&8:"
set yaml value "Scoreboard.Line-8" from file "plugins/RustZ/Scoreboard.yml" to "&aProgress&8:"
set yaml value "Scoreboard.Line-9" from file "plugins/RustZ/Scoreboard.yml" to "&3"
set yaml value "Scoreboard.Line-10" from file "plugins/RustZ/Scoreboard.yml" to "&aRadiation&8:"
set yaml value "Scoreboard.Line-11" from file "plugins/RustZ/Scoreboard.yml" to "&4"
set yaml value "Scoreboard.Line-12" from file "plugins/RustZ/Scoreboard.yml" to "&8by &9YoshYz"
#Signs.yml
set {_sign} to yaml value "Signs.Play.Line-1" from file "plugins/RustZ/Signs.yml"
if {_sign} isn't set:
message "&aRustZ&8:&7 Signs.yml &cnot found&7, creating it." to the console
set yaml value "Signs.Play.Line-1" from file "plugins/RustZ/Signs.yml" to "&6&l&m----------------"
set yaml value "Signs.Play.Line-2" from file "plugins/RustZ/Signs.yml" to "&c&lRUSTZ"
set yaml value "Signs.Play.Line-3" from file "plugins/RustZ/Signs.yml" to "play"
set yaml value "Signs.Play.Line-4" from file "plugins/RustZ/Signs.yml" to "&6&l&m----------------"
set yaml value "Signs.Spawn.Line-1" from file "plugins/RustZ/Signs.yml" to "&6&l&m----------------"
set yaml value "Signs.Spawn.Line-2" from file "plugins/RustZ/Signs.yml" to "&c&lRUSTZ"
set yaml value "Signs.Spawn.Line-3" from file "plugins/RustZ/Signs.yml" to "spawn"
set yaml value "Signs.Spawn.Line-4" from file "plugins/RustZ/Signs.yml" to "&6&l&m----------------"
#Lang.yml
set {_nopermissions} to yaml value "Messages.NoPermission" from file "plugins/RustZ/Lang.yml"
if {_nopermissions} isn't set:
message "&aRustZ&8:&7 Lang.yml &cnot found&7, creating it." to the console
set yaml value "Messages.NoPermission" from file "plugins/RustZ/Lang.yml" to "&7You don't have enought permissions to do that."
set yaml value "Panel.Crafting.Title" from file "plugins/RustZ/Lang.yml" to "&8Crafting..."
set yaml value "Messages.Warning.Pickaxe_needed" from file "plugins/RustZ/Lang.yml" to "&7You need a pickaxe to mine that."
set yaml value "Messages.Warning.Axe_needed" from file "plugins/RustZ/Lang.yml" to "&7You need an axe to cut down that."
set yaml value "Messages.Warning.Shears_needed" from file "plugins/RustZ/Lang.yml" to "&7You need a pair of shears to cut down that."
set yaml value "Messages.Warning.Too_far" from file "plugins/RustZ/Lang.yml" to "&7You're too far to perform this action."
set yaml value "Messages.Placing.Plank_placed" from file "plugins/RustZ/Lang.yml" to "&7You placed a wood plank&8:"
set yaml value "Messages.Warning.Max_planks_placed" from file "plugins/RustZ/Lang.yml" to "&7You can't place more wood planks ! &8(&cMax&8)"
set yaml value "Messages.Placing.Ironblock_placed" from file "plugins/RustZ/Lang.yml" to "&7You placed an iron block&8:"
set yaml value "Messages.Warning.Max_ironblocks_placed" from file "plugins/RustZ/Lang.yml" to "&7You can't place more iron blocks ! &8(&cMax&8)"
set yaml value "Messages.Warning.Consumed_tool" from file "plugins/RustZ/Lang.yml" to "&7You consumed your tool."
set yaml value "Messages.Crafting.Successfully" from file "plugins/RustZ/Lang.yml" to "&7You crafted successfully&8:&6"
set yaml value "Messages.Crafting.Requirements_needed" from file "plugins/RustZ/Lang.yml" to "&7You don't have all the requirements to craft that."
set yaml value "Messages.Crafting.Space_needed" from file "plugins/RustZ/Lang.yml" to "&7You need more space in your inventory."
message "&8&l&m---------------------------------------------" to the console
function loadConfig():
message "&8&l&m---------------------------------------------" to the console
message "&aRustZ&8:&7 Checking data..." to the console
#Config.yml
message "&aRustZ&8:&7 Config.yml successfully loaded." to the console
set {rconfig::prefix} to yaml value "Prefix" from file "plugins/RustZ/Config.yml"
set {rconfig::world} to yaml value "World" from file "plugins/RustZ/Config.yml"
set {rconfig::scoreboard_status} to yaml value "Scoreboard.Status" from file "plugins/RustZ/Config.yml"
set {rconfig::scoreboard_update} to yaml value "Scoreboard.Update" from file "plugins/RustZ/Config.yml"
set {rconfig::maxplanks} to yaml value "Blocks.Max.Planks" from file "plugins/RustZ/Config.yml"
set {rconfig::maxironblocks} to yaml value "Blocks.Max.Ironblocks" from file "plugins/RustZ/Config.yml"
set {rconfig::regen_cobblestone} to yaml value "Map.Regen.Cobblestone" from file "plugins/RustZ/Config.yml"
set {rconfig::regen_coalore} to yaml value "Map.Regen.Coalore" from file "plugins/RustZ/Config.yml"
set {rconfig::regen_ironore} to yaml value "Map.Regen.Ironore" from file "plugins/RustZ/Config.yml"
set {rconfig::regen_wood} to yaml value "Map.Regen.Wood" from file "plugins/RustZ/Config.yml"
set {rconfig::regen_leaves} to yaml value "Map.Regen.Leaves" from file "plugins/RustZ/Config.yml"
set {rconfig::regen_longgrass} to yaml value "Map.Regen.Long_grass" from file "plugins/RustZ/Config.yml"
set {rconfig::torch_extinguish} to yaml value "Map.Torch.Extinguish" from file "plugins/RustZ/Config.yml"
set {rconfig::torch_shut_off} to yaml value "Map.Torch.Shut_off" from file "plugins/RustZ/Config.yml"
#Scoreboard.yml
message "&aRustZ&8:&7 Scoreboard.yml successfully loaded." to the console
set {rconfig::scoreboard.title} to yaml value "Scoreboard.Title" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line1} to yaml value "Scoreboard.Line-1" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line2} to yaml value "Scoreboard.Line-2" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line3} to yaml value "Scoreboard.Line-3" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line4} to yaml value "Scoreboard.Line-4" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line5} to yaml value "Scoreboard.Line-5" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line6} to yaml value "Scoreboard.Line-6" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line7} to yaml value "Scoreboard.Line-7" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line8} to yaml value "Scoreboard.Line-8" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line9} to yaml value "Scoreboard.Line-9" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line10} to yaml value "Scoreboard.Line-10" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line11} to yaml value "Scoreboard.Line-11" from file "plugins/RustZ/Scoreboard.yml"
set {rconfig::scoreboard.line12} to yaml value "Scoreboard.Line-12" from file "plugins/RustZ/Scoreboard.yml"
#Signs.yml
message "&aRustZ&8:&7 Signs.yml successfully loaded." to the console
#Lang.yml
message "&aRustZ&8:&7 Lang.yml successfully loaded." to the console
set {rconfig::nopermissions} to yaml value "Messages.NoPermission" from file "plugins/RustZ/Lang.yml"
set {rconfig::panel_crafting_title} to yaml value "Panel.Crafting.Title" from file "plugins/RustZ/Lang.yml"
set {rconfig::pickaxe_needed} to yaml value "Messages.Warning.Pickaxe_needed" from file "plugins/RustZ/Lang.yml"
set {rconfig::axe_needed} to yaml value "Messages.Warning.Axe_needed" from file "plugins/RustZ/Lang.yml"
set {rconfig::shears_needed} to yaml value "Messages.Warning.Shears_needed" from file "plugins/RustZ/Lang.yml"
set {rconfig::too_far} to yaml value "Messages.Warning.Too_far" from file "plugins/RustZ/Lang.yml"
set {rconfig::plank_placed} to yaml value "Messages.Placing.Plank_placed" from file "plugins/RustZ/Lang.yml"
set {rconfig::max_planks_placed} to yaml value "Messages.Warning.Max_planks_placed" from file "plugins/RustZ/Lang.yml"
set {rconfig::ironblock_placed} to yaml value "Messages.Placing.Ironblock_placed" from file "plugins/RustZ/Lang.yml"
set {rconfig::max_ironblocks_placed} to yaml value "Messages.Warning.Max_ironblocks_placed" from file "plugins/RustZ/Lang.yml"
set {rconfig::consumed_tool} to yaml value "Messages.Warning.Consumed_tool" from file "plugins/RustZ/Lang.yml"
set {rconfig::crafting_succ} to yaml value "Messages.Crafting.Successfully" from file "plugins/RustZ/Lang.yml"
set {rconfig::crafting_requirements_needed} to yaml value "Messages.Crafting.Requirements_needed" from file "plugins/RustZ/Lang.yml"
set {rconfig::crafting_space_needed} to yaml value "Messages.Crafting.Space_needed" from file "plugins/RustZ/Lang.yml"
message "&8&l&m---------------------------------------------" to the console
on skript start:
createConfig()
wait 5 seconds
loadConfig()
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# PLAYERS PROFILE #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
function updatePlayer(p: player):
set yaml value "Profile.Name" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to name of {_p}
set {_kills} to yaml value "Profile.Statistics.Kills" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
if {_kills} isn't set:
set yaml value "Profile.Statistics.Kills" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
set yaml value "Profile.Statistics.Deaths" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
set yaml value "Profile.Statistics.Farm" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
set yaml value "Profile.Statistics.Data.Level" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("1" parsed as number)
set yaml value "Profile.Statistics.Data.Exp" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
set yaml value "Profile.Statistics.Data.Exp_needed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("15" parsed as number)
set yaml value "Profile.Statistics.Data_ingame.Radiation" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
set yaml value "Profile.Statistics.Data_ingame.Planks_placed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
set yaml value "Profile.Statistics.Data_ingame.Ironblocks_placed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
set {_uuid} to uuid of {_p}
set {rustz::%{_uuid}%::profile::kills} to yaml value "Profile.Statistics.Kills" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
set {rustz::%{_uuid}%::profile::deaths} to yaml value "Profile.Statistics.Deaths" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
set {rustz::%{_uuid}%::profile::farm} to yaml value "Profile.Statistics.Farm" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
set {rustz::%{_uuid}%::profile::level} to yaml value "Profile.Statistics.Data.Level" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
set {rustz::%{_uuid}%::profile::exp} to yaml value "Profile.Statistics.Data.Exp" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
set {rustz::%{_uuid}%::profile::exp_needed} to yaml value "Profile.Statistics.Data.Exp_needed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
set {rustz::%{_uuid}%::profile::radiation} to yaml value "Profile.Statistics.Data_ingame.Radiation" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
set {rustz::%{_uuid}%::profile::planks_placed} to yaml value "Profile.Statistics.Data_ingame.Planks_placed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
set {rustz::%{_uuid}%::profile::ironblocks_placed} to yaml value "Profile.Statistics.Data_ingame.Ironblocks_placed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
on join:
updatePlayer(player)
on disconnect:
clear {rustz::%uuid of player%::*}
delete {rustz::%uuid of player%}
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# COMMANDS #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
command /rustz [<text>] [<text>]:
aliases: /ru , /rust
trigger:
if argument-1 isn't set:
if player has permission "rustz.help":
make player execute command "/rustz help"
stop
else:
make player execute command "/rustz info"
stop
if argument-1 is "help":
if player has permission "rustz.help":
message centered "&a&lRUSTZ" to the player
message ""
message " &8/rustz help"
message " &8/rustz info"
message " &8/rustz set spawn"
message " &8/rustz spawn"
message " &8/rustz play"
message " &8/rustz reload"
message ""
stop
else:
message "{rconfig::prefix} {rconfig::nopermissions}"
stop
if argument-1 is "info" or "version" or "author":
message centered "&a&lRUSTZ" to the player
message ""
message "&8Author&8: &aYoshYz"
message "&8Version&8: &6{@version}"
message ""
stop
if argument-1 is "set":
if player has permission "rustz.settings":
if argument-2 is "spawn":
if player has permission "rustz.set.spawn":
set yaml value "Spawn.World" from file "plugins/RustZ/Locations.yml" to "%player's world%"
set yaml value "Spawn.X-Coords" from file "plugins/RustZ/Locations.yml" to ("%x-coord of player%" parsed as number)
set yaml value "Spawn.Y-Coords" from file "plugins/RustZ/Locations.yml" to ("%y-coord of player%" parsed as number)
set yaml value "Spawn.Z-Coords" from file "plugins/RustZ/Locations.yml" to ("%z-coord of player%" parsed as number)
message "%{rconfig::prefix}% You have setted correctly the spawn."
stop
else:
message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
stop
else:
message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
stop
if argument-1 is "reload":
if player has permission "rustz.reload":
message "%{rconfig::prefix}% RustZ settings are now loading..."
createConfig()
wait 2 seconds
loadConfig()
message "%{rconfig::prefix}% RustZ settings are now updated."
stop
else:
message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
stop
if argument-1 is "spawn":
if player has permission "rustz.spawn":
set yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to "Lobby"
set {_world} to yaml value "Spawn.World" from file "plugins/RustZ/Locations.yml"
set {_x} to yaml value "Spawn.X-Coords" from file "plugins/RustZ/Locations.yml"
set {_y} to yaml value "Spawn.Y-Coords" from file "plugins/RustZ/Locations.yml"
set {_z} to yaml value "Spawn.Z-Coords" from file "plugins/RustZ/Locations.yml"
set {_world} to {_world} parsed as world
teleport player to location at {_x}, {_y}, {_z} in world {_world}
else:
message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
stop
if argument-1 is "join" or "play":
if player has permission "rustz.join" or "rustz.play":
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
if {_check} isn't "In Game":
set player's gamemode to SURVIVAL
add a stone shovel to the player's inventory
add a torch to the player's inventory
set {_x-max} to yaml value "Join.X-max" from file "plugins/RustZ/Config.yml"
set {_x-min} to yaml value "Join.X-min" from file "plugins/RustZ/Config.yml"
set {_z-max} to yaml value "Join.Z-max" from file "plugins/RustZ/Config.yml"
set {_z-min} to yaml value "Join.Z-min" from file "plugins/RustZ/Config.yml"
set yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to "In Game"
set {_loc::old} to player's location
while {_loc::new} isn't set:
set {_loc::try} to location at random number between {_x-min} and {_x-max}, 0, random number between {_z-min} and {_z-max} in world "world"
loop blocks above {_loc::try}:
if loop-block and block above loop-block are air:
if block under loop-block isn't air or water block or lava block:
if light level at loop-block > 2:
set {_loc::new} to location of loop-block
teleport player 80 meters above {_loc::new}
spawn 1 chicken 85 meters above {_loc::new}
set {_chicken} to last spawned chicken
apply invisibility 2 without particles to {_chicken} for 999 days
wait 1 tick
make player ride {_chicken}
while block 2 meters below player is air:
play cloud at location 2 meters above player to all the players
apply resistance 100 without particles to the player for 1 second
wait 1 second
make player dismount
apply resistance 100 without particles to the player for 3 seconds
teleport {_chicken} to location at -15000, 0, 15000 in world "world"
kill {_chicken}
stop loop
wait 5 ticks
else:
message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
stop
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# RESOURCES #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
on leaves decay:
if event-world is "%{rconfig::world}%":
cancel the event
on explosion:
if event-world is "%{rconfig::world}%":
cancel the event
function regenResource(location: location, block: item):
if block at {_location} is AIR:
loop 5 times:
play stone block break at location 1 meters above {_location} to all the players
play cobble_stone block break at {_location} to all the players
play stone block break at location 1 meter below {_location} to all the players
wait 2 ticks
set block at {_location} to {_block}
on block damage:
if event-world is "%{rconfig::world}%":
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
if {_check} is "In Game":
if player's gamemode is SURVIVAL:
if event-block is COBBLE_STONE, COAL ORE or IRON ORE:
if player's tool isn't any pickaxe:
message "%{rconfig::prefix}% %{rconfig::pickaxe_needed}%"
cancel the event
stop
else:
if distance between player and event-block is more than 2:
message "%{rconfig::prefix}% %{rconfig::too_far}%"
cancel the event
else:
stop
if event-block is ANY_OAK_WOODEN_LOGS_ITEM, SPRUCE LOG or BIRCH LOG:
if player's tool isn't a iron axe, stone axe or stone shovel:
message "%{rconfig::prefix}% %{rconfig::axe_needed}%"
cancel the event
stop
else:
if distance between player and event-block is more than 4:
message "%{rconfig::prefix}% %{rconfig::too_far}%"
cancel the event
else:
stop
if event-block is ANY LEAVES or 31:1:
if player's tool isn't shears:
message "%{rconfig::prefix}% %{rconfig::shears_needed}%"
cancel the event
else:
stop
if event-block is OAK_DOOR, TORCH, LADDER, FURNACE, WORKBENCH or ANVIL:
stop
if event-block is SPRUCE WOOD PLANK:
if {rustz::planks::%location of event-block%} is set:
stop
else:
cancel the event
if event-block is IRON BLOCK:
if {rustz::ironblocks::%location of event-block%} is set:
stop
else:
cancel the event
else:
cancel the event
on break:
if event-world is "%{rconfig::world}%":
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
if {_check} is "In Game":
if player's gamemode is SURVIVAL:
if event-block is COBBLE_STONE, COAL ORE, IRON ORE, ANY_OAK_WOODEN_LOGS_ITEM, SPRUCE LOG or BIRCH LOG:
add 1 to {rustz::%uuid of player%::profile::farm}
set yaml value "Profile.Statistics.Farm" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to ("%{rustz::%uuid of player%::profile::farm}%" parsed as number)
if player's tool is wooden axe or wooden pickaxe:
chance of 10%:
remove player's tool from player's inventory
message "%{rconfig::prefix}% %{rconfig::consumed_tool}%"
if player's tool is stone axe, stone pickaxe or stone sword:
chance of 7%:
remove player's tool from player's inventory
message "%{rconfig::prefix}% %{rconfig::consumed_tool}%"
if player's tool is iron axe or iron pickaxe:
chance of 3%:
remove player's tool from player's inventory
message "%{rconfig::prefix}% %{rconfig::consumed_tool}%"
if event-block is COBBLE_STONE, COAL ORE or IRON ORE:
cancel the event
set event-block to air
if event-block is COBBLE_STONE:
drop 1 of cobble_stone at location of event-block
set {_cooldown} to {rconfig::regen_cobblestone}
set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
wait {_cooldown}
regenResource(location of event-block, COBBLE_STONE)
if event-block is COAL ORE:
drop 1 of coal ore at location of event-block
chance of 25%:
drop 1 of cobble_stone at location of event-block
set {_cooldown} to {rconfig::regen_coalore}
set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
wait {_cooldown}
regenResource(location of event-block, COAL ORE)
if event-block is IRON ORE:
drop 1 of iron ore at location of event-block
chance of 50%:
drop 1 of cobble_stone at location of event-block
set {_cooldown} to {rconfig::regen_ironore}
set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
wait {_cooldown}
regenResource(location of event-block, IRON ORE)
if event-block is ANY_OAK_WOODEN_LOGS_ITEM, SPRUCE LOG or BIRCH LOG:
cancel the event
set event-block to air
drop 1 of spruce wood plank at location of event-block
chance of 25%:
drop 1 of stick at location of event-block
chance of 10%:
drop 10 of dead bush at location of event-block
set {_cooldown} to {rconfig::regen_wood}
set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
wait {_cooldown}
if block at location of event-block is AIR:
loop 5 times:
play spruce log block break at location 1 meters above location of event-block to all the players
play birch log block break at location of event-block to all the players
play spruce log block break at location 1 meter below location of event-block to all the players
wait 2 ticks
set block at location of event-block to SPRUCE LOG
if event-block is ANY LEAVES:
cancel the event
set event-block to air
chance of 4%:
drop 1 of apple at location of event-block
chance of 25%:
drop 1 of stick at location of event-block
chance of 25%:
drop 1 of dead bush at location of event-block
set {_cooldown} to {rconfig::regen_leaves}
set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
wait {_cooldown}
if block at location of event-block is AIR:
loop 5 times:
play spruce leaves block break at location 1 meters above location of event-block to all the players
play spruce leaves block break at location of event-block to all the players
play spruce leaves block break at location 1 meter below location of event-block to all the players
wait 2 ticks
set block at location of event-block to SPRUCE LEAVES
if event-block is 31:1:
cancel the event
set event-block to air
drop 1 of 31:1 at location of event-block
chance of 10%:
drop 1 of dead bush at location of event-block
set {_cooldown} to {rconfig::regen_longgrass}
set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
wait {_cooldown}
if block at location of event-block is AIR:
loop 5 times:
play grass block break at location 1 meters above location of event-block to all the players
play grass block break at location of event-block to all the players
play grass block break at location 1 meter below location of event-block to all the players
wait 2 ticks
set block at location of event-block to 31:1
if event-block is SPRUCE WOOD PLANK:
if {rustz::planks::%location of event-block%} is set:
if player is {rustz::planks::%location of event-block%::owner}:
remove 1 from {rustz::%uuid of player%::profile::planks_placed}
delete {rustz::planks::%location of event-block%}
set yaml value "Profile.Statistics.Data_ingame.Planks_placed" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to ("%{rustz::%uuid of player%::profile::planks_placed}%" parsed as number)
stop
else:
cancel the event
else:
cancel the event
if event-block is IRON BLOCK:
if {rustz::ironblocks::%location of event-block%} is set:
if player is {rustz::ironblocks::%location of event-block%::owner}:
remove 1 from {rustz::%uuid of player%::profile::ironblocks_placed}
delete {rustz::planks::%location of event-block%}
set yaml value "Profile.Statistics.Data_ingame.Ironblocks_placed" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to ("%{rustz::%uuid of player%::profile::ironblocks_placed}%" parsed as number)
stop
else:
cancel the event
else:
cancel the event
else:
if event-block is SPRUCE WOOD PLANK:
if {rustz::planks::%location of event-block%} is set:
set {_uuid} to uuid of {rustz::planks::%location of event-block%::owner}
remove 1 from {rustz::%{_uuid}%::profile::planks_placed}
delete {rustz::planks::%location of event-block%}
set yaml value "Profile.Statistics.Data_ingame.Planks_placed" from file "plugins/RustZ/Profiles/%{_uuid}%.yml" to ("%{rustz::%{_uuid}%::profile::planks_placed}%" parsed as number)
stop
else:
cancel the event
if event-block is IRON BLOCK:
if {rustz::ironblocks::%uuid of player%::%location of event-block%} is set:
set {_uuid} to uuid of {rustz::ironblocks::%location of event-block%::owner}
remove 1 from {rustz::%{_uuid}%::profile::ironblocks_placed}
delete {rustz::ironblocks::%location of event-block%}
set yaml value "Profile.Statistics.Data_ingame.Ironblocks_placed" from file "plugins/RustZ/Profiles/%{_uuid}%.yml" to ("%{rustz::%{_uuid}%::profile::ironblocks_placed}%" parsed as number)
stop
else:
cancel the event
on place:
if event-world is "%{rconfig::world}%":
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
if {_check} is "In Game":
if player's gamemode is SURVIVAL:
if event-block is SPRUCE WOOD PLANK:
if {rustz::%uuid of player%::profile::planks_placed} < {rconfig::maxplanks}:
set {rustz::planks::%location of event-block%} to true
set {rustz::planks::%location of event-block%::owner} to player
add 1 to {rustz::%uuid of player%::profile::planks_placed}
set yaml value "Profile.Statistics.Data_ingame.Planks_placed" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to ("%{rustz::%uuid of player%::profile::planks_placed}%" parsed as number)
message "%{rconfig::prefix}% %{rconfig::plank_placed}% &8(&7%{rustz::%uuid of player%::profile::planks_placed}%&8/&a%{rconfig::maxplanks}%&8)"
stop
if {rustz::%uuid of player%::profile::planks_placed} = {rconfig::maxplanks}:
message "%{rconfig::prefix}% %{rconfig::max_planks_placed}%" to the player
cancel the event
stop
if event-block is IRON BLOCK:
if {rustz::%uuid of player%::profile::ironblocks_placed} < {rconfig::maxironblocks}:
set {rustz::ironblocks::%location of event-block%} to true
set {rustz::ironblocks::%location of event-block%::owner} to player
add 1 to {rustz::%uuid of player%::profile::ironblocks_placed}
set yaml value "Profile.Statistics.Data_ingame.Ironblocks_placed" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to ("%{rustz::%uuid of player%::profile::ironblocks_placed}%" parsed as number)
message "%{rconfig::prefix}% %{rconfig::ironblock_placed}% &8(&7%{rustz::%uuid of player%::profile::ironblocks_placed}%&8/&a%{rconfig::maxironblocks}%&8)"
stop
if {rustz::%uuid of player%::profile::ironblocks_placed} = {rconfig::maxironblocks}:
message "%{rconfig::prefix}% %{rconfig::max_ironblocks_placed}%" to the player
cancel the event
stop
if event-block is TORCH:
set {_cooldown} to {rconfig::torch_extinguish}
set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
wait {_cooldown}
if block at event-block is torch:
play large smoke at location 1 meters above location of event-block to all the players
set block at event-block to air
set block at event-block to redstone torch off
set {_cooldown} to {rconfig::torch_shut_off}
set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
wait {_cooldown}
if block at event-block is redstone torch off:
set block at event-block to air
if event-block is TNT:
set event-block to air
spawn 1 primed tnt at location of event-block
wait 4 seconds
play mob spawner flames at location 1 meters above location of event-block to all the players
create a fake explosion at location of event-block
loop all players in radius 3 of event-block:
push loop-player upwards at speed 0.9
create a fake explosion at location of loop-player
loop all blocks in radius 3 of event-block:
if loop-block is iron block:
set {_uuid} to uuid of {rustz::ironblocks::%location of loop-block%::owner}
remove 1 from {rustz::%{_uuid}%::profile::ironblocks_placed}
set yaml value "Profile.Statistics.Data_ingame.Ironblocks_placed" from file "plugins/RustZ/Profiles/%{_uuid}%.yml" to ("%{rustz::%{_uuid}%::profile::ironblocks_placed}%" parsed as number)
delete {rustz::ironblocks::%location of loop-block%}
set loop-block to air
stop loop
if loop-block is spruce wood plank:
set {_uuid} to uuid of {rustz::planks::%location of loop-block%::owner}
remove 1 from {rustz::%{_uuid}%::profile::planks_placed}
set yaml value "Profile.Statistics.Data_ingame.Planks_placed" from file "plugins/RustZ/Profiles/%{_uuid}%.yml" to ("%{rustz::%{_uuid}%::profile::planks_placed}%" parsed as number)
delete {rustz::planks::%location of loop-block%}
set loop-block to air
if event-block is OAK_DOOR, LADDER, FURNACE, WORKBENCH or ANVIL:
stop
else:
cancel the event
stop
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# SCOREBOARD #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
function createBoard(p: player, t: text, size: integer = 15):
add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
if stylish scoreboard "%{_t}%-%{_p}%" does not exist:
create new stylish scoreboard named "%{_t}%-%{_p}%"
loop {_size} times:
create a new id based score "%{_p}%Slot%loop-number%" with text "%{_d::%loop-number%}%" slot loop-number for stylish scoreboard "%{_t}%-%{_p}%"
function deleteBoard(p: player, t: text):
loop 15 times:
delete the id based score "%{_p}%Slot%loop-number%" in stylish scoreboard "%{_t}%-%{_p}%"
delete stylish scoreboard "%{_t}%-%{_p}%"
function setSlot(p: player, board: text, slot: integer, t: text):
add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
if {_slot} is between 1 and 15:
set text of id "%{_p}%Slot%{_slot}%" to "%{_d::%{_slot}%}%%{_t}%"
on disconnect:
deleteBoard(player, "%player%")
on join:
if {rconfig::scoreboard_status} is "True":
createBoard(player , "%player%", 12)
set {_delay} to "%{rconfig::scoreboard_update}%" parsed as timespan
set title of stylish scoreboard "%player%-%player%" to "%{rconfig::scoreboard.title}%"
set stylish scoreboard of player to "%player%-%player%"
wait 1 tick
while player is online:
if event-world is "%{rconfig::world}%":
if stylish scoreboard "%player%-%player%" exist:
setSlot(player , "%player%", 12, "%{rconfig::scoreboard.line1}%")
setSlot(player , "%player%", 11, "%{rconfig::scoreboard.line2}%")
setSlot(player , "%player%", 10, "%{rconfig::scoreboard.line3}% &7%{rustz::%uuid of player%::profile::kills}%")
setSlot(player , "%player%", 9, "%{rconfig::scoreboard.line4}% &7%{rustz::%uuid of player%::profile::deaths}%")
setSlot(player , "%player%", 8, "%{rconfig::scoreboard.line5}% &7%{rustz::%uuid of player%::profile::farm}%")
setSlot(player , "%player%", 7, "%{rconfig::scoreboard.line6}%")
setSlot(player , "%player%", 6, "%{rconfig::scoreboard.line7}% &6%{rustz::%uuid of player%::profile::level}%")
setSlot(player , "%player%", 5, "%{rconfig::scoreboard.line8}% &7%{rustz::%uuid of player%::profile::exp}%&8/%{rustz::%uuid of player%::profile::exp_needed}%")
setSlot(player , "%player%", 4, "%{rconfig::scoreboard.line9}%")
setSlot(player , "%player%", 3, "%{rconfig::scoreboard.line10}% &c%{rustz::%uuid of player%::profile::radiation}%")
setSlot(player , "%player%", 2, "%{rconfig::scoreboard.line11}%")
setSlot(player , "%player%", 1, "%{rconfig::scoreboard.line12}%")
else:
createBoard(player , "%player%", 12)
set title of stylish scoreboard "%player%-%player%" to "%{rconfig::scoreboard.title}%"
set stylish scoreboard of player to "%player%-%player%"
else:
if stylish scoreboard "%player%-%player%" exist:
deleteBoard(player, "%player%")
wait {_delay}
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# RECIPES #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
function openRecipesDefault(p: player, page: integer):
if {_page} is 1:
open chest with 6 rows named "&9Workbench" to {_p}
loop 54 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 10 of {_p}'s current inventory to shiny BOW named "&a&nDefense" with lore "|| &8""Here you can find everything you|| &8need to defend yourself from enemies.""|||| &aClick to open!||&r"
set slot 13 of {_p}'s current inventory to shiny TNT named "&a&nRaid" with lore "|| &8""Here you can find everything you|| &8need to raid enemy bases.""|||| &aClick to open!||&r"
set slot 30 of {_p}'s current inventory to shiny LEATHER named "&a&nProtection" with lore "|| &8""Here you can find everything you need to|| &8protect yourself from enemies and environment.""|||| &aClick to open!||&r"
set slot 32 of {_p}'s current inventory to shiny TORCH named "&a&nUtility" with lore "|| &8""Here you can find everything you|| &8need to ease your adventure.""|||| &aClick to open!||&r"
set slot 16 of {_p}'s current inventory to shiny SPRUCE WOOD PLANK named "&a&nBuildings" with lore "|| &8""Here you can find everything you need to|| &8build your base and upgrade your equipment.""|||| &aClick to open!||&r"
if {_page} is 2:
open chest with 4 rows named "&8Defense" to {_p}
loop 36 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 0 of {_p}'s current inventory to WOODEN SWORD named "&6&nWooden Sword" with lore "||&8» &9Requirements&8:|||| &8● 12x &7Wood|| &8● 2x &7Stick|||| &aClick to craft!||&r"
set slot 1 of {_p}'s current inventory to STONE SWORD named "&6&nStone Sword" with lore "||&8» &9Requirements&8:|||| &8● 12x &7Cobblestone|| &8● 2x &7Stick|||| &aClick to craft!||&r"
if {_page} is 3:
open chest with 4 rows named "&8Raid" to {_p}
loop 36 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 0 of {_p}'s current inventory to TNT named "&6&nTNT" with lore "||&8» &9Requirements&8:|||| &8● 8x &7Gunpowder|| &8● 7x &7Iron Ingot|| &8● 2x &7Dead Bush|||| &aClick to craft!||&r"
if {_page} is 4:
open chest with 4 rows named "&8Protection" to {_p}
loop 36 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 0 of {_p}'s current inventory to LEATHER HELMET named "&6&nLeather Helmet" with lore "||&8» &9Requirements&8:|||| &8● 5x &7Leather|| &8● 2x &7Grass|||| &aClick to craft!||&r"
set slot 1 of {_p}'s current inventory to LEATHER CHESTPLATE named "&6&nLeather Chestplate" with lore "||&8» &9Requirements&8:|||| &8● 8x &7Leather|| &8● 2x &7Grass|||| &aClick to craft!||&r"
set slot 2 of {_p}'s current inventory to LEATHER LEGGINGS named "&6&nLeather Leggings" with lore "||&8» &9Requirements&8:|||| &8● 7x &7Leather|| &8● 2x &7Grass|||| &aClick to craft!||&r"
set slot 3 of {_p}'s current inventory to LEATHER BOOTS named "&6&nLeather Boots" with lore "||&8» &9Requirements&8:|||| &8● 4x &7Leather|| &8● 2x &7Grass|||| &aClick to craft!||&r"
if {_page} is 5:
open chest with 4 rows named "&8Utility" to {_p}
loop 36 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 0 of {_p}'s current inventory to WOODEN PICKAXE named "&6&nWooden Pickaxe" with lore "||&8» &9Requirements&8:|||| &8● 8x &7Wood|| &8● 2x &7Stick|||| &aClick to craft!||&r"
set slot 1 of {_p}'s current inventory to STONE PICKAXE named "&6&nStone Pickaxe" with lore "||&8» &9Requirements&8:|||| &8● 8x &7Cobblestone|| &8● 2x &7Stick|||| &aClick to craft!||&r"
set slot 9 of {_p}'s current inventory to WOODEN AXE named "&6&nWooden Axe" with lore "||&8» &9Requirements&8:|||| &8● 8x &7Wood|| &8● 2x &7Stick|||| &aClick to craft!||&r"
set slot 10 of {_p}'s current inventory to STONE AXE named "&6&nStone Axe" with lore "||&8» &9Requirements&8:|||| &8● 8x &7Cobblestone|| &8● 2x &7Stick|||| &aClick to craft!||&r"
set slot 7 of {_p}'s current inventory to TORCH named "&6&nTorch" with lore "||&8» &9Requirements&8:|||| &8● 2x &7Coal|| &8● 1x &7Stick|||| &aClick to craft!||&r"
if {_page} is 6:
open chest with 4 rows named "&8Buildings" to {_p}
loop 36 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 0 of {_p}'s current inventory to NON-BURNING_FURNACE named "&6&nFurnace" with lore "||&8» &9Requirements&8:|||| &8● 48x &7Cobblestone|||| &aClick to craft!||&r"
set slot 1 of {_p}'s current inventory to ANVIL named "&6&nAnvil" with lore "||&8» &9Requirements&8:|||| &8● 24x &7Iron Ingot|| &8● 16x &7Cobblestone|| &8● 6x &7Leather|||| &aClick to craft!||&r"
set slot 35 of {_p}'s current inventory to OAK DOOR ITEM named "&6&nWooden Door" with lore "||&8» &9Requirements&8:|||| &8● 14x &7Wood|| &8● 8x &7Stick|||| &aClick to craft!||&r"
set slot 18 of {_p}'s current inventory to BLAZE POWDER named "&6&nCampfire" with lore "||&8» &9Requirements&8:|||| &8● 20x &7Wood|| &8● 10x &7Stick|| &8● 4x &7Dead Bush|||| &aClick to craft!||&r"
set slot 7 of {_p}'s current inventory to STICK named "&6&nStick" with lore "||&8» &9Requirements&8:|||| &8● 1x &7Wood|||| &aClick to craft!||&r"
set slot 8 of {_p}'s current inventory to LADDER named "&6&nLadder" with lore "||&8» &9Requirements&8:|||| &8● 8x &7Stick|||| &aClick to craft!||&r"
function openRecipesAnvil(p: player, page: integer):
if {_page} is 1:
open chest with 5 rows named "&9Anvil" to {_p}
loop 45 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 12 of {_p}'s current inventory to shiny BOW named "&a&nDefense" with lore "|| &8""Here you can find everything you|| &8need to defend yourself from enemies.""|||| &aClick to open!||&r"
set slot 14 of {_p}'s current inventory to shiny LEATHER named "&a&nProtection" with lore "|| &8""Here you can find everything you need to|| &8protect yourself from enemies and environment.""|||| &aClick to open!||&r"
set slot 31 of {_p}'s current inventory to shiny TORCH named "&a&nUtility" with lore "|| &8""Here you can find everything you|| &8need to ease your adventure.""|||| &aClick to open!||&r"
if {_page} is 2:
open chest with 4 rows named "&8Defense" to {_p}
loop 36 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 0 of {_p}'s current inventory to IRON SWORD named "&6&nIron Sword" with lore "||&8» &9Requirements&8:|||| &8● 12x &7Iron Ingot|| &8● 2x &7Stick|||| &aClick to craft!||&r"
if {_page} is 3:
open chest with 4 rows named "&8Protection" to {_p}
loop 36 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 0 of {_p}'s current inventory to IRON HELMET named "&6&nIron Helmet" with lore "||&8» &9Requirements&8:|||| &8● 5x &7Iron Ingot|||| &aClick to craft!||&r"
set slot 1 of {_p}'s current inventory to IRON CHESTPLATE named "&6&nIron Chestplate" with lore "||&8» &9Requirements&8:|||| &8● 8x &7Iron Ingot|||| &aClick to craft!||&r"
set slot 2 of {_p}'s current inventory to IRON LEGGINGS named "&6&nIron Leggings" with lore "||&8» &9Requirements&8:|||| &8● 7x &7Iron Ingot|||| &aClick to craft!||&r"
set slot 3 of {_p}'s current inventory to IRON BOOTS named "&6&nIron Boots" with lore "||&8» &9Requirements&8:|||| &8● 4x &7Iron Ingot|||| &aClick to craft!||&r"
if {_page} is 4:
open chest with 4 rows named "&8Utility" to {_p}
loop 36 times:
set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
set slot 0 of {_p}'s current inventory to SHEARS named "&6&nShears" with lore "||&8» &9Requirements&8:|||| &8● 4x &7Iron Ingot|| &8● 4x &7Stick|||| &aClick to craft!||&r"
on inventory click:
if inventory name of player's current inventory is "%{rconfig::panel_crafting_title}%":
cancel event
set {_item} to uncolored name of clicked item
set {_item} to {_item} parsed as item
#WORKBENCH
if inventory name of player's current inventory is "&9Workbench":
cancel event
if clicked slot is 10:
openRecipesDefault(player, 2)
if clicked slot is 13:
openRecipesDefault(player, 3)
if clicked slot is 30:
openRecipesDefault(player, 4)
if clicked slot is 32:
openRecipesDefault(player, 5)
if clicked slot is 16:
openRecipesDefault(player, 6)
if inventory name of player's current inventory is "&8Defense":
cancel event
if name of clicked item is " ":
if player's target block is workbench:
openRecipesDefault(player, 1)
if player's target block is anvil:
openRecipesAnvil(player, 1)
else:
if name of clicked item contains "&6&n":
rustz_craftItem(player, {_item})
if inventory name of player's current inventory is "&8Raid":
cancel event
if name of clicked item is " ":
openRecipesDefault(player, 1)
else:
if name of clicked item contains "&6&n":
rustz_craftItem(player, {_item})
if inventory name of player's current inventory is "&8Protection":
cancel event
if name of clicked item is " ":
if player's target block is workbench:
openRecipesDefault(player, 1)
if player's target block is anvil:
openRecipesAnvil(player, 1)
else:
if name of clicked item contains "&6&n":
rustz_craftItem(player, {_item})
if inventory name of player's current inventory is "&8Utility":
cancel event
if name of clicked item is " ":
if player's target block is workbench:
openRecipesDefault(player, 1)
if player's target block is anvil:
openRecipesAnvil(player, 1)
else:
if name of clicked item contains "&6&n":
rustz_craftItem(player, {_item})
if inventory name of player's current inventory is "&8Buildings":
cancel event
if name of clicked item is " ":
openRecipesDefault(player, 1)
else:
if name of clicked item contains "&6&n":
if name of clicked item contains "Furnace":
rustz_craftSItem(player, "Furnace")
stop
if name of clicked item contains "Campfire":
rustz_craftSItem(player, "Campfire")
stop
if name of clicked item contains "Wooden Door":
rustz_craftSItem(player, "Wooden Door")
stop
else:
rustz_craftItem(player, {_item})
#ANVIL
if inventory name of player's current inventory is "&9Anvil":
cancel event
if clicked slot is 12:
openRecipesAnvil(player, 2)
if clicked slot is 14:
openRecipesAnvil(player, 3)
if clicked slot is 31:
openRecipesAnvil(player, 4)
on rightclick on workbench:
if event-world is "%{rconfig::world}%":
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
if {_check} is "In Game":
cancel the event
openRecipesDefault(player, 1)
on rightclick on any anvil:
if event-world is "%{rconfig::world}%":
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
if {_check} is "In Game":
cancel the event
openRecipesAnvil(player, 1)
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# CRAFTING #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
on craft:
if event-world is "%{rconfig::world}%":
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
if {_check} is "In Game":
cancel the event
function rustz_craftItem(p: player, i: item):
craftingPanel({_p})
wait 1 second
if {_p}'s inventory has space for {_i}:
#WORKBENCH
if {_i} is WOODEN SWORD:
if {_p}'s inventory contains 12 spruce wood plank and 2 stick:
remove 12 spruce wood plank and 2 stick from {_p}'s inventory
add a wooden sword to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Wooden sword" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is STONE SWORD:
if {_p}'s inventory contains 12 cobble_stone and 2 stick:
remove 12 cobble_stone and 2 stick from {_p}'s inventory
add a stone sword to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Stone sword" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is TNT:
if {_p}'s inventory contains 8 gunpowder, 7 iron ingot and 2 dead bush:
remove 8 gunpowder, 7 iron ingot and 2 dead bush from {_p}'s inventory
add a tnt to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% TNT" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is LEATHER HELMET:
if {_p}'s inventory contains 5 leather and 2 grass:
remove 5 leather and 2 grass from {_p}'s inventory
add a leather helmet to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Leather helmet" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is LEATHER CHESTPLATE:
if {_p}'s inventory contains 8 leather and 2 grass:
remove 8 leather and 2 grass from {_p}'s inventory
add a leather chestplate to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Leather chestplate" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is LEATHER LEGGINGS:
if {_p}'s inventory contains 7 leather and 2 grass:
remove 7 leather and 2 grass from {_p}'s inventory
add a leather leggings to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Leather leggings" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is LEATHER BOOTS:
if {_p}'s inventory contains 4 leather and 2 grass:
remove 4 leather and 2 grass from {_p}'s inventory
add a leather boots to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Leather boots" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is WOODEN PICKAXE:
if {_p}'s inventory contains 8 spruce wood plank and 2 stick:
remove 8 spruce wood plank and 2 stick from {_p}'s inventory
add a wooden pickaxe to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Wooden pickaxe" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is STONE PICKAXE:
if {_p}'s inventory contains 8 cobble_stone and 2 stick:
remove 8 cobble_stone and 2 stick from {_p}'s inventory
add a stone pickaxe to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Stone pickaxe" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is WOODEN AXE:
if {_p}'s inventory contains 8 spruce wood plank and 2 stick:
remove 8 spruce wood plank and 2 stick from {_p}'s inventory
add a wooden axe to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Wooden axe" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is STONE AXE:
if {_p}'s inventory contains 8 cobble_stone and 2 stick:
remove 8 cobble_stone and 2 stick from {_p}'s inventory
add a stone axe to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Stone axe" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is TORCH:
if {_p}'s inventory contains 2 coal and 1 stick:
remove 2 coal and 1 stick from {_p}'s inventory
add a torch to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Torch" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is ANVIL:
if {_p}'s inventory contains 24 iron ingot, 16 cobble_stone and 6 leather:
remove 24 iron ingot, 16 cobble_stone and 6 leather from {_p}'s inventory
add a anvil to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Anvil" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is STICK:
if {_p}'s inventory contains 1 spruce wood plank:
remove 1 spruce wood plank from {_p}'s inventory
add a stick to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Stick" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is LADDER:
if {_p}'s inventory contains 8 stick:
remove 8 stick from {_p}'s inventory
add a ladder to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Ladder" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
#ANVIL
if {_i} is IRON SWORD:
if {_p}'s inventory contains 12 iron ingot and 2 stick:
remove 12 iron ingot and 2 stick from {_p}'s inventory
add a iron sword to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron sword" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is IRON HELMET:
if {_p}'s inventory contains 5 iron ingot:
remove 5 iron ingot from {_p}'s inventory
add a iron helmet to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron helmet" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is IRON CHESTPLATE:
if {_p}'s inventory contains 8 iron ingot:
remove 8 iron ingot from {_p}'s inventory
add a iron chestplate to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron chestplate" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is IRON LEGGINGS:
if {_p}'s inventory contains 7 iron ingot:
remove 7 iron ingot from {_p}'s inventory
add a iron leggings to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron leggings" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is IRON BOOTS:
if {_p}'s inventory contains 4 iron ingot:
remove 4 iron ingot from {_p}'s inventory
add a iron boots to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron boots" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is SHEARS:
if {_p}'s inventory contains 4 iron ingot and 4 stick:
remove 4 iron ingot and 4 stick from {_p}'s inventory
add a shears to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Shears" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
#OTHER THINGS
close {_p}'s inventory
if {_p}'s target block is workbench:
openRecipesDefault({_p}, 1)
if {_p}'s target block is anvil:
openRecipesAnvil({_p}, 1)
else:
message "%{rconfig::prefix}% %{rconfig::crafting_space_needed}%" to {_p}
function rustz_craftSItem(p: player, i: text):
craftingPanel({_p})
wait 1 second
if {_p}'s inventory has space for iron axe:
#WORKBENCH
if {_i} is "Campfire":
if {_p}'s inventory contains 20 spruce wood plank, 10 stick and 4 dead bush:
remove 20 spruce wood plank, 10 stick and 4 dead bush from {_p}'s inventory
add a blaze powder named "Campfire" to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Campfire" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is "Furnace":
if {_p}'s inventory contains 48 cobble_stone:
remove 48 cobble_stone from {_p}'s inventory
add a non-burning_furnace to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Furnace" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
if {_i} is "Wooden Door":
if {_p}'s inventory contains 14 spruce wood plank and 8 stick:
remove 14 spruce wood plank and 8 stick from {_p}'s inventory
add a oak_door to {_p}'s inventory
message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Wooden door" to {_p}
else:
message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
#OTHER THINGS
close {_p}'s inventory
if {_p}'s target block is workbench:
openRecipesDefault({_p}, 1)
if {_p}'s target block is anvil:
openRecipesAnvil({_p}, 1)
else:
message "%{rconfig::prefix}% %{rconfig::crafting_space_needed}%" to {_p}
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# ENTITIES #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
on spawn:
if event-world is "%{rconfig::world}%":
if event-entity isn't cow, pig, chicken or zombie:
cancel the event
on death of player:
if event-world is "%{rconfig::world}%":
force player to respawn
set {_world} to yaml value "Spawn.World" from file "plugins/RustZ/Locations.yml"
set {_x} to yaml value "Spawn.X-Coords" from file "plugins/RustZ/Locations.yml"
set {_y} to yaml value "Spawn.Y-Coords" from file "plugins/RustZ/Locations.yml"
set {_z} to yaml value "Spawn.Z-Coords" from file "plugins/RustZ/Locations.yml"
set {_world} to {_world} parsed as world
teleport player to location at {_x}, {_y}, {_z} in world {_world}
wait 1 tick
set yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to "Lobby"
on death:
if victim is a player:
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of victim%.yml"
if {_check} is "In Game":
add 1 to {rustz::%uuid of victim%::profile::deaths}
set yaml value "Profile.Statistics.Deaths" from file "plugins/RustZ/Profiles/%uuid of victim%.yml" to ("%{rustz::%uuid of victim%::profile::deaths}%" parsed as number)
if attacker is a player:
if attacker isn't player:
add 1 to {rustz::%uuid of attacker%::profile::kills}
set yaml value "Profile.Statistics.Kills" from file "plugins/RustZ/Profiles/%uuid of attacker%.yml" to ("%{rustz::%uuid of attacker%::profile::kills}%" parsed as number)
else:
if victim isn't a player:
if attacker is a player:
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of attacker%.yml"
if {_check} is "In Game":
add 1 to {rustz::%uuid of attacker%::profile::kills}
set yaml value "Profile.Statistics.Kills" from file "plugins/RustZ/Profiles/%uuid of attacker%.yml" to ("%{rustz::%uuid of attacker%::profile::kills}%" parsed as number)
on death of zombie:
if event-world is "%{rconfig::world}%":
remove every rotten flesh from drops
remove any helmet from drops
remove any chestplate from drops
remove any leggings from drops
remove any boots from drops
remove any axe from drops
remove any sword from drops
remove any shovel from drops
remove any hoe from drops
on combust:
if event-world is "%{rconfig::world}%":
event-entity is zombie:
cancel event
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# SIGNS #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
on sign change:
if player has permission "rustz.set.signs":
if line 1 of event-block is "[RUST]" or "[RUSTZ]":
if line 2 of event-block is "play" or "join":
set {_line-1} to yaml value "Signs.Play.Line-1" from file "plugins/RustZ/Signs.yml"
set {_line-2} to yaml value "Signs.Play.Line-2" from file "plugins/RustZ/Signs.yml"
set {_line-3} to yaml value "Signs.Play.Line-3" from file "plugins/RustZ/Signs.yml"
set {_line-4} to yaml value "Signs.Play.Line-4" from file "plugins/RustZ/Signs.yml"
set line 1 of event-block to "%{_line-1}%"
if line 2 of event-block is "spawn":
set {_line-1} to yaml value "Signs.Spawn.Line-1" from file "plugins/RustZ/Signs.yml"
set {_line-2} to yaml value "Signs.Spawn.Line-2" from file "plugins/RustZ/Signs.yml"
set {_line-3} to yaml value "Signs.Spawn.Line-3" from file "plugins/RustZ/Signs.yml"
set {_line-4} to yaml value "Signs.Spawn.Line-4" from file "plugins/RustZ/Signs.yml"
set line 1 of event-block to "%{_line-1}%"
set line 2 of event-block to "%{_line-2}%"
set line 3 of event-block to "%{_line-3}%"
set line 4 of event-block to "%{_line-4}%"
on rightclick on sign:
if line 3 of event-block contains "Spawn" or "spawn":
make player execute command "/rustz spawn"
if line 3 of event-block contains "Join", "join", "Play" or "play":
make player execute command "/rustz play"
#==========================================================================================================#
# -------------------------------------------------------------------------------------------------------- #
# SPECIAL ITEMS #
# -------------------------------------------------------------------------------------------------------- #
#==========================================================================================================#
on rightclick holding paper:
if event-world is "%{rconfig::world}%":
set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
if {_check} is "In Game":
if player's health < 10:
remove 1 of event-item from player's inventory
add 2 to player's health
loop 3 times:
play heart at location 1 meter upwards player
wait 2 ticks