1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Skript adding items back to player inventory?

Discussion in 'Skript' started by retronix, Aug 18, 2018.

Thread Status:
Not open for further replies.
  1. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    So this skript adding items back to player inventory? I looked though it but never found out why.

    Code (Skript):
    1. #  ____    _   _   ____    _____   _____
    2. # |  _ \  | | | | / ___|  |_   _| |__  /
    3. # | |_) | | | | | \___ \    | |     / /
    4. # |  _ <  | |_| |  ___) |   | |    / /_
    5. # |_| \_\  \___/  |____/    |_|   /____|
    6. #
    7.  
    8. #Author: YoshYz
    9.  
    10.  
    11. options:
    12. #==========================================================================================================#
    13. # -------------------------------------------------------------------------------------------------------- #
    14. #                                            OPTIONS                                                       #
    15. # -------------------------------------------------------------------------------------------------------- #
    16. #==========================================================================================================#    
    17.  
    18.     version: pre.0.6 Stable
    19.    
    20. #==========================================================================================================#
    21. # -------------------------------------------------------------------------------------------------------- #
    22. #                                          FUNCTIONS                                                       #
    23. # -------------------------------------------------------------------------------------------------------- #
    24. #==========================================================================================================#  
    25.  
    26. function craftingPanel(p: player):
    27.     open chest with 5 rows named "%{rconfig::panel_crafting_title}%" to {_p}
    28.     loop 54 times:
    29.         set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    30.     loop 3 times:
    31.         set slot 23 of {_p}'s current inventory to Air named " "
    32.         set slot 21 of {_p}'s current inventory to Orange Stained Glass Pane named " "
    33.         wait 2 ticks
    34.         set slot 21 of {_p}'s current inventory to Air named " "
    35.         set slot 22 of {_p}'s current inventory to Orange Stained Glass Pane named " "
    36.         wait 2 ticks
    37.         set slot 22 of {_p}'s current inventory to Air named " "
    38.         set slot 23 of {_p}'s current inventory to Orange Stained Glass Pane named " "
    39.         wait 2 ticks
    40.     set slot 21 of {_p}'s current inventory to Air named " "
    41.     set slot 22 of {_p}'s current inventory to Air named " "
    42.     set slot 23 of {_p}'s current inventory to Air named " "
    43.    
    44. #==========================================================================================================#
    45. # -------------------------------------------------------------------------------------------------------- #
    46. #                                            CONFIG                                                        #
    47. # -------------------------------------------------------------------------------------------------------- #
    48. #==========================================================================================================#
    49.  
    50. function createConfig():
    51.     message "&8&l&m---------------------------------------------" to the console
    52.     message "&aRustZ&8:&7 &8By &9YoshYz &6v{@version}" to the console
    53.     message "&aRustZ&8:&7 Checking folders..." to the console
    54. #Config.yml
    55.     set {_prefix} to yaml value "Prefix" from file "plugins/RustZ/Config.yml"
    56.     if {_prefix} isn't set:
    57.         message "&aRustZ&8:&7 Config.yml &cnot found&7, creating it." to the console
    58.         set yaml value "Prefix" from file "plugins/RustZ/Config.yml" to " &aRustZ&8:&7"
    59.         set yaml value "World" from file "plugins/RustZ/Config.yml" to "world"
    60.         set yaml value "Join.X-max" from file "plugins/RustZ/Config.yml" to ("600" parsed as number)
    61.         set yaml value "Join.X-min" from file "plugins/RustZ/Config.yml" to ("300" parsed as number)
    62.         set yaml value "Join.Z-max" from file "plugins/RustZ/Config.yml" to ("600" parsed as number)
    63.         set yaml value "Join.Z-min" from file "plugins/RustZ/Config.yml" to ("300" parsed as number)
    64.         set yaml value "Scoreboard.Status" from file "plugins/RustZ/Config.yml" to "True"
    65.         set yaml value "Scoreboard.Update" from file "plugins/RustZ/Config.yml" to "10 seconds"
    66.         set yaml value "Blocks.Max.Planks" from file "plugins/RustZ/Config.yml" to ("50" parsed as number)
    67.         set yaml value "Blocks.Max.Ironblocks" from file "plugins/RustZ/Config.yml" to ("12" parsed as number)
    68.         set yaml value "Map.Regen.Cobblestone" from file "plugins/RustZ/Config.yml" to "30 seconds"
    69.         set yaml value "Map.Regen.Coalore" from file "plugins/RustZ/Config.yml" to "2 minutes"
    70.         set yaml value "Map.Regen.Ironore" from file "plugins/RustZ/Config.yml" to "5 minutes"
    71.         set yaml value "Map.Regen.Wood" from file "plugins/RustZ/Config.yml" to "30 seconds"
    72.         set yaml value "Map.Regen.Leaves" from file "plugins/RustZ/Config.yml" to "30 seconds"
    73.         set yaml value "Map.Regen.Long_grass" from file "plugins/RustZ/Config.yml" to "10 seconds"
    74.         set yaml value "Map.Torch.Extinguish" from file "plugins/RustZ/Config.yml" to "30 minutes"
    75.         set yaml value "Map.Torch.Shut_off" from file "plugins/RustZ/Config.yml" to "2 minutes"
    76. #Scoreboard.yml
    77.     set {_scoreboard.title} to yaml value "Scoreboard.Title" from file "plugins/RustZ/Scoreboard.yml"
    78.     if {_scoreboard.title} isn't set:
    79.         message "&aRustZ&8:&7 Scoreboard.yml &cnot found&7, creating it." to the console
    80.         set yaml value "Scoreboard.Title" from file "plugins/RustZ/Scoreboard.yml" to "&a&lRustZ"
    81.         set yaml value "Scoreboard.Line-1" from file "plugins/RustZ/Scoreboard.yml" to "&1"
    82.         set yaml value "Scoreboard.Line-2" from file "plugins/RustZ/Scoreboard.yml" to "&8» &9Profile"
    83.         set yaml value "Scoreboard.Line-3" from file "plugins/RustZ/Scoreboard.yml" to "&aKills&8:"
    84.         set yaml value "Scoreboard.Line-4" from file "plugins/RustZ/Scoreboard.yml" to "&aDeaths&8:"
    85.         set yaml value "Scoreboard.Line-5" from file "plugins/RustZ/Scoreboard.yml" to "&aFarming&8:"
    86.         set yaml value "Scoreboard.Line-6" from file "plugins/RustZ/Scoreboard.yml" to "&2"
    87.         set yaml value "Scoreboard.Line-7" from file "plugins/RustZ/Scoreboard.yml" to "&aLevel&8:"
    88.         set yaml value "Scoreboard.Line-8" from file "plugins/RustZ/Scoreboard.yml" to "&aProgress&8:"
    89.         set yaml value "Scoreboard.Line-9" from file "plugins/RustZ/Scoreboard.yml" to "&3"
    90.         set yaml value "Scoreboard.Line-10" from file "plugins/RustZ/Scoreboard.yml" to "&aRadiation&8:"
    91.         set yaml value "Scoreboard.Line-11" from file "plugins/RustZ/Scoreboard.yml" to "&4"
    92.         set yaml value "Scoreboard.Line-12" from file "plugins/RustZ/Scoreboard.yml" to "&8by &9YoshYz"
    93. #Signs.yml
    94.     set {_sign} to yaml value "Signs.Play.Line-1" from file "plugins/RustZ/Signs.yml"
    95.     if {_sign} isn't set:
    96.         message "&aRustZ&8:&7 Signs.yml &cnot found&7, creating it." to the console
    97.         set yaml value "Signs.Play.Line-1" from file "plugins/RustZ/Signs.yml" to "&6&l&m----------------"
    98.         set yaml value "Signs.Play.Line-2" from file "plugins/RustZ/Signs.yml" to "&c&lRUSTZ"
    99.         set yaml value "Signs.Play.Line-3" from file "plugins/RustZ/Signs.yml" to "play"
    100.         set yaml value "Signs.Play.Line-4" from file "plugins/RustZ/Signs.yml" to "&6&l&m----------------"
    101.         set yaml value "Signs.Spawn.Line-1" from file "plugins/RustZ/Signs.yml" to "&6&l&m----------------"
    102.         set yaml value "Signs.Spawn.Line-2" from file "plugins/RustZ/Signs.yml" to "&c&lRUSTZ"
    103.         set yaml value "Signs.Spawn.Line-3" from file "plugins/RustZ/Signs.yml" to "spawn"
    104.         set yaml value "Signs.Spawn.Line-4" from file "plugins/RustZ/Signs.yml" to "&6&l&m----------------"
    105. #Lang.yml
    106.     set {_nopermissions} to yaml value "Messages.NoPermission" from file "plugins/RustZ/Lang.yml"
    107.     if {_nopermissions} isn't set:
    108.         message "&aRustZ&8:&7 Lang.yml &cnot found&7, creating it." to the console
    109.         set yaml value "Messages.NoPermission" from file "plugins/RustZ/Lang.yml" to "&7You don't have enought permissions to do that."
    110.         set yaml value "Panel.Crafting.Title" from file "plugins/RustZ/Lang.yml" to "&8Crafting..."
    111.         set yaml value "Messages.Warning.Pickaxe_needed" from file "plugins/RustZ/Lang.yml" to "&7You need a pickaxe to mine that."
    112.         set yaml value "Messages.Warning.Axe_needed" from file "plugins/RustZ/Lang.yml" to "&7You need an axe to cut down that."
    113.         set yaml value "Messages.Warning.Shears_needed" from file "plugins/RustZ/Lang.yml" to "&7You need a pair of shears to cut down that."
    114.         set yaml value "Messages.Warning.Too_far" from file "plugins/RustZ/Lang.yml" to "&7You're too far to perform this action."
    115.         set yaml value "Messages.Placing.Plank_placed" from file "plugins/RustZ/Lang.yml" to "&7You placed a wood plank&8:"
    116.         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)"
    117.         set yaml value "Messages.Placing.Ironblock_placed" from file "plugins/RustZ/Lang.yml" to "&7You placed an iron block&8:"
    118.         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)"
    119.         set yaml value "Messages.Warning.Consumed_tool" from file "plugins/RustZ/Lang.yml" to "&7You consumed your tool."
    120.         set yaml value "Messages.Crafting.Successfully" from file "plugins/RustZ/Lang.yml" to "&7You crafted successfully&8:&6"
    121.         set yaml value "Messages.Crafting.Requirements_needed" from file "plugins/RustZ/Lang.yml" to "&7You don't have all the requirements to craft that."
    122.         set yaml value "Messages.Crafting.Space_needed" from file "plugins/RustZ/Lang.yml" to "&7You need more space in your inventory."
    123.     message "&8&l&m---------------------------------------------" to the console
    124.        
    125. function loadConfig():
    126.     message "&8&l&m---------------------------------------------" to the console
    127.     message "&aRustZ&8:&7 Checking data..." to the console
    128. #Config.yml
    129.     message "&aRustZ&8:&7 Config.yml successfully loaded." to the console
    130.     set {rconfig::prefix} to yaml value "Prefix" from file "plugins/RustZ/Config.yml"
    131.     set {rconfig::world} to yaml value "World" from file "plugins/RustZ/Config.yml"
    132.     set {rconfig::scoreboard_status} to yaml value "Scoreboard.Status" from file "plugins/RustZ/Config.yml"
    133.     set {rconfig::scoreboard_update} to yaml value "Scoreboard.Update" from file "plugins/RustZ/Config.yml"
    134.     set {rconfig::maxplanks} to yaml value "Blocks.Max.Planks" from file "plugins/RustZ/Config.yml"
    135.     set {rconfig::maxironblocks} to yaml value "Blocks.Max.Ironblocks" from file "plugins/RustZ/Config.yml"
    136.     set {rconfig::regen_cobblestone} to yaml value "Map.Regen.Cobblestone" from file "plugins/RustZ/Config.yml"
    137.     set {rconfig::regen_coalore} to yaml value "Map.Regen.Coalore" from file "plugins/RustZ/Config.yml"
    138.     set {rconfig::regen_ironore} to yaml value "Map.Regen.Ironore" from file "plugins/RustZ/Config.yml"
    139.     set {rconfig::regen_wood} to yaml value "Map.Regen.Wood" from file "plugins/RustZ/Config.yml"
    140.     set {rconfig::regen_leaves} to yaml value "Map.Regen.Leaves" from file "plugins/RustZ/Config.yml"
    141.     set {rconfig::regen_longgrass} to yaml value "Map.Regen.Long_grass" from file "plugins/RustZ/Config.yml"
    142.     set {rconfig::torch_extinguish} to yaml value "Map.Torch.Extinguish" from file "plugins/RustZ/Config.yml"
    143.     set {rconfig::torch_shut_off} to yaml value "Map.Torch.Shut_off" from file "plugins/RustZ/Config.yml"
    144. #Scoreboard.yml
    145.     message "&aRustZ&8:&7 Scoreboard.yml successfully loaded." to the console
    146.     set {rconfig::scoreboard.title} to yaml value "Scoreboard.Title" from file "plugins/RustZ/Scoreboard.yml"
    147.     set {rconfig::scoreboard.line1} to yaml value "Scoreboard.Line-1" from file "plugins/RustZ/Scoreboard.yml"
    148.     set {rconfig::scoreboard.line2} to yaml value "Scoreboard.Line-2" from file "plugins/RustZ/Scoreboard.yml"
    149.     set {rconfig::scoreboard.line3} to yaml value "Scoreboard.Line-3" from file "plugins/RustZ/Scoreboard.yml"
    150.     set {rconfig::scoreboard.line4} to yaml value "Scoreboard.Line-4" from file "plugins/RustZ/Scoreboard.yml"
    151.     set {rconfig::scoreboard.line5} to yaml value "Scoreboard.Line-5" from file "plugins/RustZ/Scoreboard.yml"
    152.     set {rconfig::scoreboard.line6} to yaml value "Scoreboard.Line-6" from file "plugins/RustZ/Scoreboard.yml"
    153.     set {rconfig::scoreboard.line7} to yaml value "Scoreboard.Line-7" from file "plugins/RustZ/Scoreboard.yml"
    154.     set {rconfig::scoreboard.line8} to yaml value "Scoreboard.Line-8" from file "plugins/RustZ/Scoreboard.yml"
    155.     set {rconfig::scoreboard.line9} to yaml value "Scoreboard.Line-9" from file "plugins/RustZ/Scoreboard.yml"
    156.     set {rconfig::scoreboard.line10} to yaml value "Scoreboard.Line-10" from file "plugins/RustZ/Scoreboard.yml"
    157.     set {rconfig::scoreboard.line11} to yaml value "Scoreboard.Line-11" from file "plugins/RustZ/Scoreboard.yml"
    158.     set {rconfig::scoreboard.line12} to yaml value "Scoreboard.Line-12" from file "plugins/RustZ/Scoreboard.yml"
    159. #Signs.yml
    160.     message "&aRustZ&8:&7 Signs.yml successfully loaded." to the console
    161. #Lang.yml
    162.     message "&aRustZ&8:&7 Lang.yml successfully loaded." to the console
    163.     set {rconfig::nopermissions} to yaml value "Messages.NoPermission" from file "plugins/RustZ/Lang.yml"
    164.     set {rconfig::panel_crafting_title} to yaml value "Panel.Crafting.Title" from file "plugins/RustZ/Lang.yml"
    165.     set {rconfig::pickaxe_needed} to yaml value "Messages.Warning.Pickaxe_needed" from file "plugins/RustZ/Lang.yml"
    166.     set {rconfig::axe_needed} to yaml value "Messages.Warning.Axe_needed" from file "plugins/RustZ/Lang.yml"
    167.     set {rconfig::shears_needed} to yaml value "Messages.Warning.Shears_needed" from file "plugins/RustZ/Lang.yml"
    168.     set {rconfig::too_far} to yaml value "Messages.Warning.Too_far" from file "plugins/RustZ/Lang.yml"
    169.     set {rconfig::plank_placed} to yaml value "Messages.Placing.Plank_placed" from file "plugins/RustZ/Lang.yml"
    170.     set {rconfig::max_planks_placed} to yaml value "Messages.Warning.Max_planks_placed" from file "plugins/RustZ/Lang.yml"
    171.     set {rconfig::ironblock_placed} to yaml value "Messages.Placing.Ironblock_placed" from file "plugins/RustZ/Lang.yml"
    172.     set {rconfig::max_ironblocks_placed} to yaml value "Messages.Warning.Max_ironblocks_placed" from file "plugins/RustZ/Lang.yml"
    173.     set {rconfig::consumed_tool} to yaml value "Messages.Warning.Consumed_tool" from file "plugins/RustZ/Lang.yml"
    174.     set {rconfig::crafting_succ} to yaml value "Messages.Crafting.Successfully" from file "plugins/RustZ/Lang.yml"
    175.     set {rconfig::crafting_requirements_needed} to yaml value "Messages.Crafting.Requirements_needed" from file "plugins/RustZ/Lang.yml"
    176.     set {rconfig::crafting_space_needed} to yaml value "Messages.Crafting.Space_needed" from file "plugins/RustZ/Lang.yml"
    177.     message "&8&l&m---------------------------------------------" to the console
    178.    
    179. on skript start:
    180.     createConfig()
    181.     wait 5 seconds
    182.     loadConfig()
    183.    
    184. #==========================================================================================================#
    185. # -------------------------------------------------------------------------------------------------------- #
    186. #                                        PLAYERS PROFILE                                                   #
    187. # -------------------------------------------------------------------------------------------------------- #
    188. #==========================================================================================================#
    189.  
    190. function updatePlayer(p: player):
    191.     set yaml value "Profile.Name" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to name of {_p}
    192.     set {_kills} to yaml value "Profile.Statistics.Kills" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    193.     if {_kills} isn't set:
    194.         set yaml value "Profile.Statistics.Kills" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
    195.         set yaml value "Profile.Statistics.Deaths" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
    196.         set yaml value "Profile.Statistics.Farm" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
    197.         set yaml value "Profile.Statistics.Data.Level" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("1" parsed as number)
    198.         set yaml value "Profile.Statistics.Data.Exp" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
    199.         set yaml value "Profile.Statistics.Data.Exp_needed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("15" parsed as number)
    200.         set yaml value "Profile.Statistics.Data_ingame.Radiation" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
    201.         set yaml value "Profile.Statistics.Data_ingame.Planks_placed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
    202.         set yaml value "Profile.Statistics.Data_ingame.Ironblocks_placed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml" to ("0" parsed as number)
    203.     set {_uuid} to uuid of {_p}
    204.     set {rustz::%{_uuid}%::profile::kills} to yaml value "Profile.Statistics.Kills" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    205.     set {rustz::%{_uuid}%::profile::deaths} to yaml value "Profile.Statistics.Deaths" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    206.     set {rustz::%{_uuid}%::profile::farm} to yaml value "Profile.Statistics.Farm" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    207.     set {rustz::%{_uuid}%::profile::level} to yaml value "Profile.Statistics.Data.Level" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    208.     set {rustz::%{_uuid}%::profile::exp} to yaml value "Profile.Statistics.Data.Exp" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    209.     set {rustz::%{_uuid}%::profile::exp_needed} to yaml value "Profile.Statistics.Data.Exp_needed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    210.     set {rustz::%{_uuid}%::profile::radiation} to yaml value "Profile.Statistics.Data_ingame.Radiation" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    211.     set {rustz::%{_uuid}%::profile::planks_placed} to yaml value "Profile.Statistics.Data_ingame.Planks_placed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    212.     set {rustz::%{_uuid}%::profile::ironblocks_placed} to yaml value "Profile.Statistics.Data_ingame.Ironblocks_placed" from file "plugins/RustZ/Profiles/%uuid of {_p}%.yml"
    213.    
    214. on join:
    215.     updatePlayer(player)
    216.    
    217. on disconnect:
    218.     clear {rustz::%uuid of player%::*}
    219.     delete {rustz::%uuid of player%}
    220.    
    221. #==========================================================================================================#
    222. # -------------------------------------------------------------------------------------------------------- #
    223. #                                             COMMANDS                                                     #
    224. # -------------------------------------------------------------------------------------------------------- #
    225. #==========================================================================================================#
    226.  
    227. command /rustz [<text>] [<text>]:
    228.     aliases: /ru , /rust
    229.     trigger:
    230.         if argument-1 isn't set:
    231.             if player has permission "rustz.help":
    232.                 make player execute command "/rustz help"
    233.                 stop
    234.             else:
    235.                 make player execute command "/rustz info"
    236.                 stop
    237.         if argument-1 is "help":
    238.             if player has permission "rustz.help":
    239.                 message centered "&a&lRUSTZ" to the player
    240.                 message ""
    241.                 message " &8/rustz help"
    242.                 message " &8/rustz info"
    243.                 message " &8/rustz set spawn"
    244.                 message " &8/rustz spawn"
    245.                 message " &8/rustz play"
    246.                 message " &8/rustz reload"
    247.                 message ""
    248.                 stop
    249.             else:
    250.                 message "{rconfig::prefix} {rconfig::nopermissions}"
    251.                 stop
    252.         if argument-1 is "info" or "version" or "author":
    253.             message centered "&a&lRUSTZ" to the player
    254.             message ""
    255.             message "&8Author&8: &aYoshYz"
    256.             message "&8Version&8: &6{@version}"
    257.             message ""
    258.             stop
    259.         if argument-1 is "set":
    260.             if player has permission "rustz.settings":
    261.                 if argument-2 is "spawn":
    262.                     if player has permission "rustz.set.spawn":
    263.                         set yaml value "Spawn.World" from file "plugins/RustZ/Locations.yml" to "%player's world%"
    264.                         set yaml value "Spawn.X-Coords" from file "plugins/RustZ/Locations.yml" to ("%x-coord of player%" parsed as number)
    265.                         set yaml value "Spawn.Y-Coords" from file "plugins/RustZ/Locations.yml" to ("%y-coord of player%" parsed as number)
    266.                         set yaml value "Spawn.Z-Coords" from file "plugins/RustZ/Locations.yml" to ("%z-coord of player%" parsed as number)
    267.                         message "%{rconfig::prefix}% You have setted correctly the spawn."
    268.                         stop
    269.                     else:
    270.                         message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
    271.                         stop
    272.             else:
    273.                 message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
    274.                 stop
    275.         if argument-1 is "reload":
    276.             if player has permission "rustz.reload":
    277.                 message "%{rconfig::prefix}% RustZ settings are now loading..."
    278.                 createConfig()
    279.                 wait 2 seconds
    280.                 loadConfig()
    281.                 message "%{rconfig::prefix}% RustZ settings are now updated."
    282.                 stop
    283.             else:
    284.                 message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
    285.                 stop
    286.         if argument-1 is "spawn":
    287.             if player has permission "rustz.spawn":
    288.                 set yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to "Lobby"
    289.                 set {_world} to yaml value "Spawn.World" from file "plugins/RustZ/Locations.yml"
    290.                 set {_x} to yaml value "Spawn.X-Coords" from file "plugins/RustZ/Locations.yml"
    291.                 set {_y} to yaml value "Spawn.Y-Coords" from file "plugins/RustZ/Locations.yml"
    292.                 set {_z} to yaml value "Spawn.Z-Coords" from file "plugins/RustZ/Locations.yml"
    293.                 set {_world} to {_world} parsed as world
    294.                 teleport player to location at {_x}, {_y}, {_z} in world {_world}
    295.             else:
    296.                 message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
    297.                 stop
    298.         if argument-1 is "join" or "play":
    299.             if player has permission "rustz.join" or "rustz.play":
    300.                 set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
    301.                 if {_check} isn't "In Game":
    302.                     set player's gamemode to SURVIVAL
    303.                     add a stone shovel to the player's inventory
    304.                     add a torch to the player's inventory
    305.                     set {_x-max} to yaml value "Join.X-max" from file "plugins/RustZ/Config.yml"
    306.                     set {_x-min} to yaml value "Join.X-min" from file "plugins/RustZ/Config.yml"
    307.                     set {_z-max} to yaml value "Join.Z-max" from file "plugins/RustZ/Config.yml"
    308.                     set {_z-min} to yaml value "Join.Z-min" from file "plugins/RustZ/Config.yml"
    309.                     set yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to "In Game"
    310.                     set {_loc::old} to player's location
    311.                     while {_loc::new} isn't set:
    312.                         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"
    313.                         loop blocks above {_loc::try}:
    314.                             if loop-block and block above loop-block are air:
    315.                                 if block under loop-block isn't air or water block or lava block:
    316.                                     if light level at loop-block > 2:
    317.                                         set {_loc::new} to location of loop-block                              
    318.                                         teleport player 80 meters above {_loc::new}
    319.                                         spawn 1 chicken 85 meters above {_loc::new}  
    320.                                         set {_chicken} to last spawned chicken                          
    321.                                         apply invisibility 2 without particles to {_chicken} for 999 days
    322.                                         wait 1 tick
    323.                                         make player ride {_chicken}
    324.                                         while block 2 meters below player is air:
    325.                                             play cloud at location 2 meters above player to all the players
    326.                                             apply resistance 100 without particles to the player for 1 second
    327.                                             wait 1 second
    328.                                         make player dismount
    329.                                         apply resistance 100 without particles to the player for 3 seconds
    330.                                         teleport {_chicken} to location at -15000, 0, 15000 in world "world"
    331.                                         kill  {_chicken}                                                        
    332.                                         stop loop
    333.                         wait 5 ticks
    334.             else:
    335.                 message "%{rconfig::prefix}% %{rconfig::nopermissions}%"
    336.                 stop
    337.                
    338. #==========================================================================================================#
    339. # -------------------------------------------------------------------------------------------------------- #
    340. #                                            RESOURCES                                                     #
    341. # -------------------------------------------------------------------------------------------------------- #
    342. #==========================================================================================================#
    343.  
    344. on leaves decay:
    345.     if event-world is "%{rconfig::world}%":
    346.         cancel the event
    347.    
    348. on explosion:
    349.     if event-world is "%{rconfig::world}%":
    350.         cancel the event
    351.    
    352. function regenResource(location: location, block: item):
    353.     if block at {_location} is AIR:
    354.         loop 5 times:
    355.             play stone block break at location 1 meters above {_location} to all the players                    
    356.             play cobble_stone block break at {_location} to all the players
    357.             play stone block break at location 1 meter below {_location} to all the players
    358.             wait 2 ticks
    359.         set block at {_location} to {_block}
    360.        
    361. on block damage:
    362.     if event-world is "%{rconfig::world}%":
    363.         set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
    364.         if {_check} is "In Game":
    365.             if player's gamemode is SURVIVAL:
    366.                 if event-block is COBBLE_STONE, COAL ORE or IRON ORE:
    367.                     if player's tool isn't any pickaxe:
    368.                         message "%{rconfig::prefix}% %{rconfig::pickaxe_needed}%"
    369.                         cancel the event
    370.                         stop
    371.                     else:
    372.                         if distance between player and event-block is more than 2:
    373.                             message "%{rconfig::prefix}% %{rconfig::too_far}%"
    374.                             cancel the event
    375.                         else:
    376.                             stop
    377.                 if event-block is ANY_OAK_WOODEN_LOGS_ITEM, SPRUCE LOG or BIRCH LOG:
    378.                     if player's tool isn't a iron axe, stone axe or stone shovel:
    379.                         message "%{rconfig::prefix}% %{rconfig::axe_needed}%"
    380.                         cancel the event
    381.                         stop
    382.                     else:
    383.                         if distance between player and event-block is more than 4:
    384.                             message "%{rconfig::prefix}% %{rconfig::too_far}%"
    385.                             cancel the event
    386.                         else:
    387.                             stop
    388.                 if event-block is ANY LEAVES or 31:1:
    389.                     if player's tool isn't shears:
    390.                         message "%{rconfig::prefix}% %{rconfig::shears_needed}%"
    391.                         cancel the event
    392.                     else:
    393.                         stop
    394.                 if event-block is OAK_DOOR, TORCH, LADDER, FURNACE, WORKBENCH or ANVIL:
    395.                     stop
    396.                 if event-block is SPRUCE WOOD PLANK:
    397.                     if {rustz::planks::%location of event-block%} is set:
    398.                         stop
    399.                     else:
    400.                         cancel the event
    401.                 if event-block is IRON BLOCK:
    402.                     if {rustz::ironblocks::%location of event-block%} is set:
    403.                         stop
    404.                     else:
    405.                         cancel the event
    406.                 else:
    407.                     cancel the event
    408.    
    409. on break:
    410.     if event-world is "%{rconfig::world}%":
    411.         set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
    412.         if {_check} is "In Game":
    413.             if player's gamemode is SURVIVAL:
    414.                 if event-block is COBBLE_STONE, COAL ORE, IRON ORE, ANY_OAK_WOODEN_LOGS_ITEM, SPRUCE LOG or BIRCH LOG:
    415.                     add 1 to {rustz::%uuid of player%::profile::farm}
    416.                     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)
    417.                     if player's tool is wooden axe or wooden pickaxe:
    418.                         chance of 10%:
    419.                             remove player's tool from player's inventory
    420.                             message "%{rconfig::prefix}% %{rconfig::consumed_tool}%"
    421.                     if player's tool is stone axe, stone pickaxe or stone sword:
    422.                         chance of 7%:
    423.                             remove player's tool from player's inventory
    424.                             message "%{rconfig::prefix}% %{rconfig::consumed_tool}%"
    425.                     if player's tool is iron axe or iron pickaxe:
    426.                         chance of 3%:
    427.                             remove player's tool from player's inventory
    428.                             message "%{rconfig::prefix}% %{rconfig::consumed_tool}%"
    429.                 if event-block is COBBLE_STONE, COAL ORE or IRON ORE:
    430.                     cancel the event
    431.                     set event-block to air
    432.                     if event-block is COBBLE_STONE:
    433.                         drop 1 of cobble_stone at location of event-block
    434.                         set {_cooldown} to {rconfig::regen_cobblestone}
    435.                         set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
    436.                         wait {_cooldown}
    437.                         regenResource(location of event-block, COBBLE_STONE)
    438.                     if event-block is COAL ORE:
    439.                         drop 1 of coal ore at location of event-block
    440.                         chance of 25%:
    441.                             drop 1 of cobble_stone at location of event-block
    442.                             set {_cooldown} to {rconfig::regen_coalore}
    443.                             set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
    444.                             wait {_cooldown}
    445.                             regenResource(location of event-block, COAL ORE)
    446.                     if event-block is IRON ORE:
    447.                         drop 1 of iron ore at location of event-block
    448.                         chance of 50%:
    449.                             drop 1 of cobble_stone at location of event-block
    450.                         set {_cooldown} to {rconfig::regen_ironore}
    451.                         set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
    452.                         wait {_cooldown}
    453.                         regenResource(location of event-block, IRON ORE)
    454.                 if event-block is ANY_OAK_WOODEN_LOGS_ITEM, SPRUCE LOG or BIRCH LOG:
    455.                     cancel the event
    456.                     set event-block to air
    457.                     drop 1 of spruce wood plank at location of event-block
    458.                     chance of 25%:
    459.                         drop 1 of stick at location of event-block
    460.                     chance of 10%:
    461.                         drop 10 of dead bush at location of event-block
    462.                     set {_cooldown} to {rconfig::regen_wood}
    463.                     set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
    464.                     wait {_cooldown}
    465.                     if block at location of event-block is AIR:
    466.                         loop 5 times:
    467.                             play spruce log block break at location 1 meters above location of event-block to all the players                    
    468.                             play birch log block break at location of event-block to all the players
    469.                             play spruce log block break at location 1 meter below location of event-block to all the players
    470.                             wait 2 ticks
    471.                         set block at location of event-block to SPRUCE LOG
    472.                 if event-block is ANY LEAVES:
    473.                     cancel the event
    474.                     set event-block to air
    475.                     chance of 4%:
    476.                         drop 1 of apple at location of event-block
    477.                     chance of 25%:
    478.                         drop 1 of stick at location of event-block
    479.                     chance of 25%:
    480.                         drop 1 of dead bush at location of event-block
    481.                     set {_cooldown} to {rconfig::regen_leaves}
    482.                     set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
    483.                     wait {_cooldown}
    484.                     if block at location of event-block is AIR:
    485.                         loop 5 times:
    486.                             play spruce leaves block break at location 1 meters above location of event-block to all the players                    
    487.                             play spruce leaves block break at location of event-block to all the players
    488.                             play spruce leaves block break at location 1 meter below location of event-block to all the players
    489.                             wait 2 ticks
    490.                         set block at location of event-block to SPRUCE LEAVES
    491.                 if event-block is 31:1:
    492.                     cancel the event
    493.                     set event-block to air
    494.                     drop 1 of 31:1 at location of event-block
    495.                     chance of 10%:
    496.                         drop 1 of dead bush at location of event-block
    497.                     set {_cooldown} to {rconfig::regen_longgrass}
    498.                     set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
    499.                     wait {_cooldown}
    500.                     if block at location of event-block is AIR:
    501.                         loop 5 times:
    502.                             play grass block break at location 1 meters above location of event-block to all the players                    
    503.                             play grass block break at location of event-block to all the players
    504.                             play grass block break at location 1 meter below location of event-block to all the players
    505.                             wait 2 ticks
    506.                         set block at location of event-block to 31:1
    507.                 if event-block is SPRUCE WOOD PLANK:
    508.                     if {rustz::planks::%location of event-block%} is set:
    509.                         if player is {rustz::planks::%location of event-block%::owner}:
    510.                             remove 1 from {rustz::%uuid of player%::profile::planks_placed}
    511.                             delete {rustz::planks::%location of event-block%}
    512.                             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)
    513.                             stop
    514.                         else:
    515.                             cancel the event
    516.                     else:
    517.                         cancel the event
    518.                 if event-block is IRON BLOCK:
    519.                     if {rustz::ironblocks::%location of event-block%} is set:
    520.                         if player is {rustz::ironblocks::%location of event-block%::owner}:
    521.                             remove 1 from {rustz::%uuid of player%::profile::ironblocks_placed}
    522.                             delete {rustz::planks::%location of event-block%}
    523.                             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)
    524.                             stop
    525.                         else:
    526.                             cancel the event
    527.                     else:
    528.                         cancel the event
    529.             else:
    530.                 if event-block is SPRUCE WOOD PLANK:
    531.                     if {rustz::planks::%location of event-block%} is set:
    532.                         set {_uuid} to uuid of {rustz::planks::%location of event-block%::owner}
    533.                         remove 1 from {rustz::%{_uuid}%::profile::planks_placed}
    534.                         delete {rustz::planks::%location of event-block%}
    535.                         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)
    536.                         stop
    537.                     else:
    538.                         cancel the event
    539.                 if event-block is IRON BLOCK:
    540.                     if {rustz::ironblocks::%uuid of player%::%location of event-block%} is set:
    541.                         set {_uuid} to uuid of {rustz::ironblocks::%location of event-block%::owner}
    542.                         remove 1 from {rustz::%{_uuid}%::profile::ironblocks_placed}
    543.                         delete {rustz::ironblocks::%location of event-block%}
    544.                         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)
    545.                         stop
    546.                     else:
    547.                         cancel the event
    548.                    
    549. on place:
    550.     if event-world is "%{rconfig::world}%":
    551.         set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
    552.         if {_check} is "In Game":
    553.             if player's gamemode is SURVIVAL:
    554.                 if event-block is SPRUCE WOOD PLANK:
    555.                     if {rustz::%uuid of player%::profile::planks_placed} < {rconfig::maxplanks}:
    556.                         set {rustz::planks::%location of event-block%} to true
    557.                         set {rustz::planks::%location of event-block%::owner} to player
    558.                         add 1 to {rustz::%uuid of player%::profile::planks_placed}
    559.                         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)
    560.                         message "%{rconfig::prefix}% %{rconfig::plank_placed}% &8(&7%{rustz::%uuid of player%::profile::planks_placed}%&8/&a%{rconfig::maxplanks}%&8)"
    561.                         stop
    562.                     if {rustz::%uuid of player%::profile::planks_placed} = {rconfig::maxplanks}:
    563.                         message "%{rconfig::prefix}% %{rconfig::max_planks_placed}%" to the player
    564.                         cancel the event
    565.                         stop
    566.                 if event-block is IRON BLOCK:
    567.                     if {rustz::%uuid of player%::profile::ironblocks_placed} < {rconfig::maxironblocks}:
    568.                         set {rustz::ironblocks::%location of event-block%} to true
    569.                         set {rustz::ironblocks::%location of event-block%::owner} to player
    570.                         add 1 to {rustz::%uuid of player%::profile::ironblocks_placed}
    571.                         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)
    572.                         message "%{rconfig::prefix}% %{rconfig::ironblock_placed}% &8(&7%{rustz::%uuid of player%::profile::ironblocks_placed}%&8/&a%{rconfig::maxironblocks}%&8)"
    573.                         stop
    574.                     if {rustz::%uuid of player%::profile::ironblocks_placed} = {rconfig::maxironblocks}:
    575.                         message "%{rconfig::prefix}% %{rconfig::max_ironblocks_placed}%" to the player
    576.                         cancel the event
    577.                         stop
    578.                 if event-block is TORCH:
    579.                     set {_cooldown} to {rconfig::torch_extinguish}
    580.                     set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
    581.                     wait {_cooldown}
    582.                     if block at event-block is torch:
    583.                         play large smoke at location 1 meters above location of event-block to all the players
    584.                         set block at event-block to air
    585.                         set block at event-block to redstone torch off
    586.                         set {_cooldown} to {rconfig::torch_shut_off}
    587.                         set {_cooldown} to "%{_cooldown}% seconds" parsed as timespan
    588.                         wait {_cooldown}
    589.                         if block at event-block is redstone torch off:
    590.                             set block at event-block to air      
    591.                 if event-block is TNT:
    592.                     set event-block to air
    593.                     spawn 1 primed tnt at location of event-block
    594.                     wait 4 seconds
    595.                     play mob spawner flames at location 1 meters above location of event-block to all the players
    596.                     create a fake explosion at location of event-block  
    597.                     loop all players in radius 3 of event-block:
    598.                         push loop-player upwards at speed 0.9
    599.                         create a fake explosion at location of loop-player
    600.                     loop all blocks in radius 3 of event-block:
    601.                         if loop-block is iron block:
    602.                             set {_uuid} to uuid of {rustz::ironblocks::%location of loop-block%::owner}
    603.                             remove 1 from {rustz::%{_uuid}%::profile::ironblocks_placed}
    604.                             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)
    605.                             delete {rustz::ironblocks::%location of loop-block%}  
    606.                             set loop-block to air
    607.                             stop loop
    608.                         if loop-block is spruce wood plank:  
    609.                             set {_uuid} to uuid of {rustz::planks::%location of loop-block%::owner}
    610.                             remove 1 from {rustz::%{_uuid}%::profile::planks_placed}
    611.                             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)
    612.                             delete {rustz::planks::%location of loop-block%}  
    613.                             set loop-block to air                  
    614.                 if event-block is OAK_DOOR, LADDER, FURNACE, WORKBENCH or ANVIL:
    615.                     stop
    616.                 else:
    617.                     cancel the event
    618.                     stop
    619.                
    620. #==========================================================================================================#
    621. # -------------------------------------------------------------------------------------------------------- #
    622. #                                             SCOREBOARD                                                   #
    623. # -------------------------------------------------------------------------------------------------------- #
    624. #==========================================================================================================#
    625.  
    626. function createBoard(p: player, t: text, size: integer = 15):
    627.     add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
    628.     if stylish scoreboard "%{_t}%-%{_p}%" does not exist:
    629.         create new stylish scoreboard named "%{_t}%-%{_p}%"
    630.         loop {_size} times:
    631.             create a new id based score "%{_p}%Slot%loop-number%" with text "%{_d::%loop-number%}%" slot loop-number for stylish scoreboard "%{_t}%-%{_p}%"
    632.            
    633. function deleteBoard(p: player, t: text):
    634.     loop 15 times:
    635.         delete the id based score "%{_p}%Slot%loop-number%" in stylish scoreboard "%{_t}%-%{_p}%"
    636.     delete stylish scoreboard "%{_t}%-%{_p}%"
    637.    
    638. function setSlot(p: player, board: text, slot: integer, t: text):
    639.     add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
    640.     if {_slot} is between 1 and 15:
    641.         set text of id "%{_p}%Slot%{_slot}%" to "%{_d::%{_slot}%}%%{_t}%"
    642.        
    643. on disconnect:
    644.     deleteBoard(player, "%player%")
    645.    
    646. on join:
    647.     if {rconfig::scoreboard_status} is "True":
    648.         createBoard(player , "%player%", 12)
    649.         set {_delay} to "%{rconfig::scoreboard_update}%" parsed as timespan
    650.         set title of stylish scoreboard "%player%-%player%" to "%{rconfig::scoreboard.title}%"
    651.         set stylish scoreboard of player to "%player%-%player%"
    652.         wait 1 tick
    653.         while player is online:
    654.             if event-world is "%{rconfig::world}%":
    655.                 if stylish scoreboard "%player%-%player%" exist:
    656.                     setSlot(player , "%player%", 12, "%{rconfig::scoreboard.line1}%")
    657.                     setSlot(player , "%player%", 11, "%{rconfig::scoreboard.line2}%")
    658.                     setSlot(player , "%player%", 10, "%{rconfig::scoreboard.line3}% &7%{rustz::%uuid of player%::profile::kills}%")
    659.                     setSlot(player , "%player%", 9, "%{rconfig::scoreboard.line4}% &7%{rustz::%uuid of player%::profile::deaths}%")
    660.                     setSlot(player , "%player%", 8, "%{rconfig::scoreboard.line5}% &7%{rustz::%uuid of player%::profile::farm}%")
    661.                     setSlot(player , "%player%", 7, "%{rconfig::scoreboard.line6}%")
    662.                     setSlot(player , "%player%", 6, "%{rconfig::scoreboard.line7}% &6%{rustz::%uuid of player%::profile::level}%")
    663.                     setSlot(player , "%player%", 5, "%{rconfig::scoreboard.line8}% &7%{rustz::%uuid of player%::profile::exp}%&8/%{rustz::%uuid of player%::profile::exp_needed}%")
    664.                     setSlot(player , "%player%", 4, "%{rconfig::scoreboard.line9}%")
    665.                     setSlot(player , "%player%", 3, "%{rconfig::scoreboard.line10}% &c%{rustz::%uuid of player%::profile::radiation}%")
    666.                     setSlot(player , "%player%", 2, "%{rconfig::scoreboard.line11}%")
    667.                     setSlot(player , "%player%", 1, "%{rconfig::scoreboard.line12}%")
    668.                 else:
    669.                     createBoard(player , "%player%", 12)
    670.                     set title of stylish scoreboard "%player%-%player%" to "%{rconfig::scoreboard.title}%"
    671.                     set stylish scoreboard of player to "%player%-%player%"
    672.             else:
    673.                 if stylish scoreboard "%player%-%player%" exist:
    674.                     deleteBoard(player, "%player%")
    675.             wait {_delay}
    676.            
    677. #==========================================================================================================#
    678. # -------------------------------------------------------------------------------------------------------- #
    679. #                                              RECIPES                                                     #
    680. # -------------------------------------------------------------------------------------------------------- #
    681. #==========================================================================================================#
    682.  
    683. function openRecipesDefault(p: player, page: integer):
    684.     if {_page} is 1:
    685.         open chest with 6 rows named "&9Workbench" to {_p}
    686.         loop 54 times:
    687.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    688.         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"
    689.         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"
    690.         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"
    691.         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"
    692.         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"
    693.     if {_page} is 2:
    694.         open chest with 4 rows named "&8Defense" to {_p}
    695.         loop 36 times:
    696.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    697.         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"
    698.         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"
    699.     if {_page} is 3:
    700.         open chest with 4 rows named "&8Raid" to {_p}
    701.         loop 36 times:
    702.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    703.         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"
    704.     if {_page} is 4:
    705.         open chest with 4 rows named "&8Protection" to {_p}
    706.         loop 36 times:
    707.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    708.         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"
    709.         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"
    710.         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"
    711.         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"
    712.     if {_page} is 5:
    713.         open chest with 4 rows named "&8Utility" to {_p}
    714.         loop 36 times:
    715.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    716.         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"
    717.         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"
    718.         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"
    719.         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"
    720.         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"
    721.     if {_page} is 6:
    722.         open chest with 4 rows named "&8Buildings" to {_p}
    723.         loop 36 times:
    724.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    725.         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"
    726.         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"
    727.         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"
    728.         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"
    729.         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"
    730.         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"
    731.        
    732. function openRecipesAnvil(p: player, page: integer):
    733.     if {_page} is 1:
    734.         open chest with 5 rows named "&9Anvil" to {_p}
    735.         loop 45 times:
    736.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    737.         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"
    738.         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"
    739.         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"
    740.     if {_page} is 2:
    741.         open chest with 4 rows named "&8Defense" to {_p}
    742.         loop 36 times:
    743.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    744.         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"
    745.     if {_page} is 3:
    746.         open chest with 4 rows named "&8Protection" to {_p}
    747.         loop 36 times:
    748.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    749.         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"
    750.         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"
    751.         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"
    752.         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"        
    753.     if {_page} is 4:
    754.         open chest with 4 rows named "&8Utility" to {_p}
    755.         loop 36 times:
    756.             set slot loop-number -1 of {_p}'s current inventory to Gray Stained Glass Pane named " "
    757.         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"
    758.  
    759. on inventory click:
    760.     if inventory name of player's current inventory is "%{rconfig::panel_crafting_title}%":
    761.         cancel event
    762.     set {_item} to uncolored name of clicked item
    763.     set {_item} to {_item} parsed as item
    764. #WORKBENCH
    765.     if inventory name of player's current inventory is "&9Workbench":
    766.         cancel event
    767.         if clicked slot is 10:
    768.             openRecipesDefault(player, 2)
    769.         if clicked slot is 13:
    770.             openRecipesDefault(player, 3)
    771.         if clicked slot is 30:
    772.             openRecipesDefault(player, 4)
    773.         if clicked slot is 32:
    774.             openRecipesDefault(player, 5)
    775.         if clicked slot is 16:
    776.             openRecipesDefault(player, 6)
    777.     if inventory name of player's current inventory is "&8Defense":
    778.         cancel event
    779.         if name of clicked item is " ":
    780.             if player's target block is workbench:
    781.                 openRecipesDefault(player, 1)
    782.             if player's target block is anvil:
    783.                 openRecipesAnvil(player, 1)
    784.         else:
    785.             if name of clicked item contains "&6&n":
    786.                 rustz_craftItem(player, {_item})
    787.     if inventory name of player's current inventory is "&8Raid":
    788.         cancel event      
    789.         if name of clicked item is " ":
    790.             openRecipesDefault(player, 1)
    791.         else:
    792.             if name of clicked item contains "&6&n":
    793.                 rustz_craftItem(player, {_item})
    794.     if inventory name of player's current inventory is "&8Protection":
    795.         cancel event
    796.         if name of clicked item is " ":
    797.             if player's target block is workbench:
    798.                 openRecipesDefault(player, 1)
    799.             if player's target block is anvil:
    800.                 openRecipesAnvil(player, 1)
    801.         else:
    802.             if name of clicked item contains "&6&n":
    803.                 rustz_craftItem(player, {_item})
    804.     if inventory name of player's current inventory is "&8Utility":
    805.         cancel event
    806.         if name of clicked item is " ":
    807.             if player's target block is workbench:
    808.                 openRecipesDefault(player, 1)
    809.             if player's target block is anvil:
    810.                 openRecipesAnvil(player, 1)
    811.         else:
    812.             if name of clicked item contains "&6&n":
    813.                 rustz_craftItem(player, {_item})
    814.     if inventory name of player's current inventory is "&8Buildings":
    815.         cancel event
    816.         if name of clicked item is " ":
    817.             openRecipesDefault(player, 1)
    818.         else:
    819.             if name of clicked item contains "&6&n":
    820.                 if name of clicked item contains "Furnace":
    821.                     rustz_craftSItem(player, "Furnace")
    822.                     stop
    823.                 if name of clicked item contains "Campfire":
    824.                     rustz_craftSItem(player, "Campfire")
    825.                     stop
    826.                 if name of clicked item contains "Wooden Door":
    827.                     rustz_craftSItem(player, "Wooden Door")
    828.                     stop
    829.                 else:
    830.                     rustz_craftItem(player, {_item})
    831. #ANVIL
    832.     if inventory name of player's current inventory is "&9Anvil":
    833.         cancel event
    834.         if clicked slot is 12:
    835.             openRecipesAnvil(player, 2)
    836.         if clicked slot is 14:
    837.             openRecipesAnvil(player, 3)
    838.         if clicked slot is 31:
    839.             openRecipesAnvil(player, 4)
    840.        
    841. on rightclick on workbench:
    842.     if event-world is "%{rconfig::world}%":
    843.         set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
    844.         if {_check} is "In Game":
    845.             cancel the event
    846.             openRecipesDefault(player, 1)
    847.        
    848. on rightclick on any anvil:
    849.     if event-world is "%{rconfig::world}%":
    850.         set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
    851.         if {_check} is "In Game":
    852.             cancel the event
    853.             openRecipesAnvil(player, 1)
    854.        
    855. #==========================================================================================================#
    856. # -------------------------------------------------------------------------------------------------------- #
    857. #                                              CRAFTING                                                    #
    858. # -------------------------------------------------------------------------------------------------------- #
    859. #==========================================================================================================#
    860.  
    861. on craft:
    862.     if event-world is "%{rconfig::world}%":
    863.         set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
    864.         if {_check} is "In Game":
    865.             cancel the event
    866.  
    867. function rustz_craftItem(p: player, i: item):
    868.     craftingPanel({_p})
    869.     wait 1 second
    870.     if {_p}'s inventory has space for {_i}:
    871. #WORKBENCH
    872.         if {_i} is WOODEN SWORD:
    873.             if {_p}'s inventory contains 12 spruce wood plank and 2 stick:
    874.                 remove 12 spruce wood plank and 2 stick from {_p}'s inventory
    875.                 add a wooden sword to {_p}'s inventory
    876.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Wooden sword" to {_p}
    877.             else:
    878.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    879.         if {_i} is STONE SWORD:
    880.             if {_p}'s inventory contains 12 cobble_stone and 2 stick:
    881.                 remove 12 cobble_stone and 2 stick from {_p}'s inventory
    882.                 add a stone sword to {_p}'s inventory
    883.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Stone sword" to {_p}
    884.             else:
    885.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    886.         if {_i} is TNT:
    887.             if {_p}'s inventory contains 8 gunpowder, 7 iron ingot and 2 dead bush:
    888.                 remove 8 gunpowder, 7 iron ingot and 2 dead bush from {_p}'s inventory
    889.                 add a tnt to {_p}'s inventory
    890.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% TNT" to {_p}
    891.             else:
    892.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    893.         if {_i} is LEATHER HELMET:
    894.             if {_p}'s inventory contains 5 leather and 2 grass:
    895.                 remove 5 leather and 2 grass from {_p}'s inventory
    896.                 add a leather helmet to {_p}'s inventory
    897.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Leather helmet" to {_p}
    898.             else:
    899.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    900.         if {_i} is LEATHER CHESTPLATE:
    901.             if {_p}'s inventory contains 8 leather and 2 grass:
    902.                 remove 8 leather and 2 grass from {_p}'s inventory
    903.                 add a leather chestplate to {_p}'s inventory
    904.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Leather chestplate" to {_p}
    905.             else:
    906.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    907.         if {_i} is LEATHER LEGGINGS:
    908.             if {_p}'s inventory contains 7 leather and 2 grass:
    909.                 remove 7 leather and 2 grass from {_p}'s inventory
    910.                 add a leather leggings to {_p}'s inventory
    911.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Leather leggings" to {_p}
    912.             else:
    913.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    914.         if {_i} is LEATHER BOOTS:
    915.             if {_p}'s inventory contains 4 leather and 2 grass:
    916.                 remove 4 leather and 2 grass from {_p}'s inventory
    917.                 add a leather boots to {_p}'s inventory
    918.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Leather boots" to {_p}
    919.             else:
    920.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    921.         if {_i} is WOODEN PICKAXE:
    922.             if {_p}'s inventory contains 8 spruce wood plank and 2 stick:
    923.                 remove 8 spruce wood plank and 2 stick from {_p}'s inventory
    924.                 add a wooden pickaxe to {_p}'s inventory
    925.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Wooden pickaxe" to {_p}
    926.             else:
    927.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    928.         if {_i} is STONE PICKAXE:
    929.             if {_p}'s inventory contains 8 cobble_stone and 2 stick:
    930.                 remove 8 cobble_stone and 2 stick from {_p}'s inventory
    931.                 add a stone pickaxe to {_p}'s inventory
    932.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Stone pickaxe" to {_p}
    933.             else:
    934.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    935.         if {_i} is WOODEN AXE:
    936.             if {_p}'s inventory contains 8 spruce wood plank and 2 stick:
    937.                 remove 8 spruce wood plank and 2 stick from {_p}'s inventory
    938.                 add a wooden axe to {_p}'s inventory
    939.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Wooden axe" to {_p}
    940.             else:
    941.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    942.         if {_i} is STONE AXE:
    943.             if {_p}'s inventory contains 8 cobble_stone and 2 stick:
    944.                 remove 8 cobble_stone and 2 stick from {_p}'s inventory
    945.                 add a stone axe to {_p}'s inventory
    946.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Stone axe" to {_p}
    947.             else:
    948.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    949.         if {_i} is TORCH:
    950.             if {_p}'s inventory contains 2 coal and 1 stick:
    951.                 remove 2 coal and 1 stick from {_p}'s inventory
    952.                 add a torch to {_p}'s inventory
    953.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Torch" to {_p}
    954.             else:
    955.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    956.         if {_i} is ANVIL:
    957.             if {_p}'s inventory contains 24 iron ingot, 16 cobble_stone and 6 leather:
    958.                 remove 24 iron ingot, 16 cobble_stone and 6 leather from {_p}'s inventory
    959.                 add a anvil to {_p}'s inventory
    960.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Anvil" to {_p}
    961.             else:
    962.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    963.         if {_i} is STICK:
    964.             if {_p}'s inventory contains 1 spruce wood plank:
    965.                 remove 1 spruce wood plank from {_p}'s inventory
    966.                 add a stick to {_p}'s inventory
    967.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Stick" to {_p}
    968.             else:
    969.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    970.         if {_i} is LADDER:
    971.             if {_p}'s inventory contains 8 stick:
    972.                 remove 8 stick from {_p}'s inventory
    973.                 add a ladder to {_p}'s inventory
    974.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Ladder" to {_p}
    975.             else:
    976.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    977. #ANVIL
    978.         if {_i} is IRON SWORD:
    979.             if {_p}'s inventory contains 12 iron ingot and 2 stick:
    980.                 remove 12 iron ingot and 2 stick from {_p}'s inventory
    981.                 add a iron sword to {_p}'s inventory
    982.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron sword" to {_p}
    983.             else:
    984.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    985.         if {_i} is IRON HELMET:
    986.             if {_p}'s inventory contains 5 iron ingot:
    987.                 remove 5 iron ingot from {_p}'s inventory
    988.                 add a iron helmet to {_p}'s inventory
    989.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron helmet" to {_p}
    990.             else:
    991.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    992.         if {_i} is IRON CHESTPLATE:
    993.             if {_p}'s inventory contains 8 iron ingot:
    994.                 remove 8 iron ingot from {_p}'s inventory
    995.                 add a iron chestplate to {_p}'s inventory
    996.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron chestplate" to {_p}
    997.             else:
    998.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    999.         if {_i} is IRON LEGGINGS:
    1000.             if {_p}'s inventory contains 7 iron ingot:
    1001.                 remove 7 iron ingot from {_p}'s inventory
    1002.                 add a iron leggings to {_p}'s inventory
    1003.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron leggings" to {_p}
    1004.             else:
    1005.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    1006.         if {_i} is IRON BOOTS:
    1007.             if {_p}'s inventory contains 4 iron ingot:
    1008.                 remove 4 iron ingot from {_p}'s inventory
    1009.                 add a iron boots to {_p}'s inventory
    1010.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Iron boots" to {_p}
    1011.             else:
    1012.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    1013.         if {_i} is SHEARS:
    1014.             if {_p}'s inventory contains 4 iron ingot and 4 stick:
    1015.                 remove 4 iron ingot and 4 stick from {_p}'s inventory
    1016.                 add a shears to {_p}'s inventory
    1017.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Shears" to {_p}
    1018.             else:
    1019.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    1020. #OTHER THINGS
    1021.         close {_p}'s inventory
    1022.         if {_p}'s target block is workbench:
    1023.             openRecipesDefault({_p}, 1)
    1024.         if {_p}'s target block is anvil:
    1025.             openRecipesAnvil({_p}, 1)
    1026.     else:
    1027.         message "%{rconfig::prefix}% %{rconfig::crafting_space_needed}%" to {_p}
    1028.        
    1029. function rustz_craftSItem(p: player, i: text):
    1030.     craftingPanel({_p})
    1031.     wait 1 second
    1032.     if {_p}'s inventory has space for iron axe:
    1033. #WORKBENCH
    1034.         if {_i} is "Campfire":
    1035.             if {_p}'s inventory contains 20 spruce wood plank, 10 stick and 4 dead bush:
    1036.                 remove 20 spruce wood plank, 10 stick and 4 dead bush from {_p}'s inventory
    1037.                 add a blaze powder named "Campfire" to {_p}'s inventory
    1038.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Campfire" to {_p}
    1039.             else:
    1040.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    1041.         if {_i} is "Furnace":
    1042.             if {_p}'s inventory contains 48 cobble_stone:
    1043.                 remove 48 cobble_stone from {_p}'s inventory
    1044.                 add a non-burning_furnace to {_p}'s inventory
    1045.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Furnace" to {_p}
    1046.             else:
    1047.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    1048.         if {_i} is "Wooden Door":
    1049.             if {_p}'s inventory contains 14 spruce wood plank and 8 stick:
    1050.                 remove 14 spruce wood plank and 8 stick from {_p}'s inventory
    1051.                 add a oak_door to {_p}'s inventory
    1052.                 message "%{rconfig::prefix}% %{rconfig::crafting_succ}% Wooden door" to {_p}
    1053.             else:
    1054.                 message "%{rconfig::prefix}% %{rconfig::crafting_requirements_needed}%" to {_p}
    1055. #OTHER THINGS
    1056.         close {_p}'s inventory
    1057.         if {_p}'s target block is workbench:
    1058.             openRecipesDefault({_p}, 1)
    1059.         if {_p}'s target block is anvil:
    1060.             openRecipesAnvil({_p}, 1)
    1061.     else:
    1062.         message "%{rconfig::prefix}% %{rconfig::crafting_space_needed}%" to {_p}
    1063.        
    1064. #==========================================================================================================#
    1065. # -------------------------------------------------------------------------------------------------------- #
    1066. #                                              ENTITIES                                                    #
    1067. # -------------------------------------------------------------------------------------------------------- #
    1068. #==========================================================================================================#
    1069.  
    1070. on spawn:
    1071.     if event-world is "%{rconfig::world}%":
    1072.         if event-entity isn't cow, pig, chicken or zombie:
    1073.             cancel the event
    1074.  
    1075. on death of player:
    1076.     if event-world is "%{rconfig::world}%":
    1077.         force player to respawn
    1078.         set {_world} to yaml value "Spawn.World" from file "plugins/RustZ/Locations.yml"
    1079.         set {_x} to yaml value "Spawn.X-Coords" from file "plugins/RustZ/Locations.yml"
    1080.         set {_y} to yaml value "Spawn.Y-Coords" from file "plugins/RustZ/Locations.yml"
    1081.         set {_z} to yaml value "Spawn.Z-Coords" from file "plugins/RustZ/Locations.yml"
    1082.         set {_world} to {_world} parsed as world
    1083.         teleport player to location at {_x}, {_y}, {_z} in world {_world}
    1084.         wait 1 tick
    1085.         set yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to "Lobby"
    1086.        
    1087. on death:
    1088.     if victim is a player:
    1089.         set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of victim%.yml"
    1090.         if {_check} is "In Game":
    1091.             add 1 to {rustz::%uuid of victim%::profile::deaths}
    1092.             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)  
    1093.             if attacker is a player:
    1094.                 if attacker isn't player:
    1095.                     add 1 to {rustz::%uuid of attacker%::profile::kills}
    1096.                     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)
    1097.     else:
    1098.         if victim isn't a player:
    1099.             if attacker is a player:
    1100.                 set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of attacker%.yml"
    1101.                 if {_check} is "In Game":
    1102.                     add 1 to {rustz::%uuid of attacker%::profile::kills}
    1103.                     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)
    1104.  
    1105. on death of zombie:
    1106.     if event-world is "%{rconfig::world}%":
    1107.         remove every rotten flesh from drops
    1108.         remove any helmet from drops
    1109.         remove any chestplate from drops
    1110.         remove any leggings from drops
    1111.         remove any boots from drops
    1112.         remove any axe from drops
    1113.         remove any sword from drops
    1114.         remove any shovel from drops
    1115.         remove any hoe from drops
    1116.    
    1117. on combust:
    1118.     if event-world is "%{rconfig::world}%":
    1119.         event-entity is zombie:
    1120.             cancel event
    1121.    
    1122. #==========================================================================================================#
    1123. # -------------------------------------------------------------------------------------------------------- #
    1124. #                                                SIGNS                                                     #
    1125. # -------------------------------------------------------------------------------------------------------- #
    1126. #==========================================================================================================#
    1127.  
    1128. on sign change:
    1129.     if player has permission "rustz.set.signs":
    1130.         if line 1 of event-block is "[RUST]" or "[RUSTZ]":
    1131.             if line 2 of event-block is "play" or "join":
    1132.                 set {_line-1} to yaml value "Signs.Play.Line-1" from file "plugins/RustZ/Signs.yml"
    1133.                 set {_line-2} to yaml value "Signs.Play.Line-2" from file "plugins/RustZ/Signs.yml"
    1134.                 set {_line-3} to yaml value "Signs.Play.Line-3" from file "plugins/RustZ/Signs.yml"
    1135.                 set {_line-4} to yaml value "Signs.Play.Line-4" from file "plugins/RustZ/Signs.yml"
    1136.                 set line 1 of event-block to "%{_line-1}%"
    1137.             if line 2 of event-block is "spawn":
    1138.                 set {_line-1} to yaml value "Signs.Spawn.Line-1" from file "plugins/RustZ/Signs.yml"
    1139.                 set {_line-2} to yaml value "Signs.Spawn.Line-2" from file "plugins/RustZ/Signs.yml"
    1140.                 set {_line-3} to yaml value "Signs.Spawn.Line-3" from file "plugins/RustZ/Signs.yml"
    1141.                 set {_line-4} to yaml value "Signs.Spawn.Line-4" from file "plugins/RustZ/Signs.yml"
    1142.             set line 1 of event-block to "%{_line-1}%"
    1143.             set line 2 of event-block to "%{_line-2}%"
    1144.             set line 3 of event-block to "%{_line-3}%"
    1145.             set line 4 of event-block to "%{_line-4}%"
    1146.            
    1147. on rightclick on sign:
    1148.     if line 3 of event-block contains "Spawn" or "spawn":
    1149.         make player execute command "/rustz spawn"
    1150.     if line 3 of event-block contains "Join", "join", "Play" or "play":
    1151.         make player execute command "/rustz play"
    1152.        
    1153. #==========================================================================================================#
    1154. # -------------------------------------------------------------------------------------------------------- #
    1155. #                                          SPECIAL ITEMS                                                   #
    1156. # -------------------------------------------------------------------------------------------------------- #
    1157. #==========================================================================================================#
    1158.  
    1159. on rightclick holding paper:
    1160.     if event-world is "%{rconfig::world}%":
    1161.         set {_check} to yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml"
    1162.         if {_check} is "In Game":
    1163.             if player's health < 10:
    1164.                 remove 1 of event-item from player's inventory
    1165.                 add 2 to player's health
    1166.                 loop 3 times:
    1167.                     play heart at location 1 meter upwards player
    1168.                     wait 2 ticks
    1169.  
    1170.        
    1171.    
    1172.            
    1173.                
    1174.                    
    1175.  
    1176.    
    1177.  
    1178.                              
    1179.  
    1180.        
    1181.        
    1182.  
    1183.  
    1184.        
    1185.        
    1186.  
    1187.  
    1188.  
    1189.  
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    I suggest posting in the discussion page for Rustz and hopefully YoshYz will answer you there.
     
  3. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    He dosent seem to answer thats why i came here :emoji_grinning:
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    Well again I suggest posting on the discussion, since you haven't yet, and see if Yosh answers. That really is your best bet since he wrote it.
     
  5. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    Well, your here now. Why cant you just tell me whats keeping the player inventory?
    Im not doing anythign worng, Not claiming it as my own. I simply just wan to turn off keep inventory
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    When you say "keeping the player inventory" are you meaning during a death event?
     
  7. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    Well when i die and respawn, It thows my previous items (That i had before i died) on the ground for me to pick them up
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    Then what exactly is your issue? That is what vanilla minecraft does when you die, it drops your items on the ground.
     
  9. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    I know that. But it gives the items back to me... It never leaves them where i died
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    Ok I will look over the code again, but i don't think this Skript is doing that.
     
  11. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    If i remove the skript it drops the items where i died
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    So i think its due to this part Line 1076
    Code (Skript):
    1.    
    2. on death of player:
    3.     if event-world is "%{rconfig::world}%":
    4.         set yaml value "Profile.Status" from file "plugins/RustZ/Profiles/%uuid of player%.yml" to "Lobby"
    5.         force player to respawn
    6.         set {_world} to yaml value "Spawn.World" from file "plugins/RustZ/Locations.yml"
    7.         set {_x} to yaml value "Spawn.X-Coords" from file "plugins/RustZ/Locations.yml"
    8.         set {_y} to yaml value "Spawn.Y-Coords" from file "plugins/RustZ/Locations.yml"
    9.         set {_z} to yaml value "Spawn.Z-Coords" from file "plugins/RustZ/Locations.yml"
    10.         set {_world} to {_world} parsed as world
    11.         teleport player to location at {_x}, {_y}, {_z} in world {_world}
    Basically what its doing is Teleporting you to where you died. So its not keeping the items in the inventory, its just Tp'ing you to exactly where the items dropped
    --- Double Post Merged, Aug 18, 2018, Original Post Date: Aug 18, 2018 ---
    NOPE I change my answer :emoji_wink:
    Its because the force respawn is happening too fast.
    so before and after "force player to respawn" add "wait 1 tick"
    like this:
    Code (Skript):
    1. wait 1 tick
    2. force player to respawn
    3. wait 1 tick
     
    #12 ShaneBee, Aug 18, 2018
    Last edited: Aug 18, 2018
  13. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    Oh thanks!
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    You're welcome :emoji_slight_smile:
     
  15. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    How would i go on about placing plants on say wood?
     
  16. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    Is that in reference to this same Skript?
    If the answer is yes, then Im not sure, as im not the creator of this Skript.
    If the answer is no, I recommend starting a new thread since this one is solved and a different topic.
    Also... Im not sure what you mean by plants? So when you do start your new thread please make sure to give details on that :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...