on script load: if file "plugins/UltimateHomes/homes.yml" does't exist: load yaml "plugins/UltimateHomes/homes.yml" as "config" send "&a&lᴜʟᴛɪᴍᴀᴛᴇ ʜᴏᴍᴇs &8- &fᴄʀᴇᴀᴛɪɴɢ ғɪʟᴇs" to console stop else: send "&a&lᴜʟᴛɪᴍᴀᴛᴇ ʜᴏᴍᴇs &8- &fᴇɴᴀʙʟɪɴɢ" to console stop command /home [] [] []: aliases: dom trigger: if arg 1 is not set: execute player command "home help" if arg 1 is "help" or "pomoc": send " &a&lᴜʟᴛɪᴍᴀᴛᴇ ʜᴏᴍᴇs" to player send "" to player send "&a&l• &f/home set &8- &7Set home at your location" to player send "&a&l• &f/home rem &8- &7Remove specified home" to player send "&a&l• &f/home rename &8- &7Rename home" to player send "&a&l• &f/home list &8- &7Show your homes list" to player send "&a&l• &f/home tp &8- &7Teleport to specified home" to player send "&a&l• &f/home &8- &7Open your homes menu" to player send "" to player if player has permission "home.help.adm": wait 3 ticks send "&c&lᴀᴅᴍɪɴ ᴄᴏᴍᴍᴀɴᴅs" to player send "" to player send "&a&l• &f/home del &8- &7Delete player's home" to player send "&a&l• &f/home add &8- &7Create home for other player" to player send "&a&l• &f/home tp &8- &7Teleport to other player's home" to player send "&a&l• &f/home list &8- &7Show other players homes list" to player send "&a&l• &f/home menu &8- &7Open other players homes menu" to player send "" to player stop if arg 1 is not set: if player has permission "home.menu": set {_m} to chest inventory with 3 rows named "&a&lᴜʟᴛɪᴍᴀᴛᴇ ʜᴏᴍᴇs" if {_homes::%player%} is 0: set slot 10 and 11 and 12 and 13 and 14 and 15 and 16 of {_m} to red candle named "&c&lᴇᴍᴘᴛʏ ʜᴏᴍᴇ" with lore "&8&l| &7Home is not set!%nl%&8&l| &7You can set it with /home set" if {_homes::%player%} is 1: set slot 11 and 12 and 13 and 14 and 15 and 16 of {_m} to red candle named "&c&lᴇᴍᴘᴛʏ ʜᴏᴍᴇ" with lore "&8&l| &7Home is not set!%nl%&8&l| &7You can set it with /home set!" set slot 10 of {_m} to lime candle named "&a&l%{_home::%player%::1}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::1}%%nl%&8&l| &fTp into this home by clicking" if {_homes::%player%} is 2: set slot 12 and 13 and 14 and 15 and 16 of {_m} to red candle named "&c&lᴇᴍᴘᴛʏ ʜᴏᴍᴇ" with lore "&8&l| &7Home is not set!%nl%&8&l| &7You can set it with /home set!" set slot 10 of {_m} to lime candle named "&a&l%{_home::%player%::1}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::1}%%nl%&8&l| &fTp into this home by clicking" set slot 11 of {_m} to lime candle named "&a&l%{_home::%player%::2}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::2}%%nl%&8&l| &fTp into this home by clicking" if {_homes::%player%} is 3: set slot 13 and 14 and 15 and 16 of {_m} to red candle named "&c&lᴇᴍᴘᴛʏ ʜᴏᴍᴇ" with lore "&8&l| &7Home is not set!%nl%&8&l| &7You can set it with /home set!" set slot 10 of {_m} to lime candle named "&a&l%{_home::%player%::1}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::1}%%nl%&8&l| &fTp into this home by clicking" set slot 11 of {_m} to lime candle named "&a&l%{_home::%player%::2}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::2}%%nl%&8&l| &fTp into this home by clicking" set slot 12 of {_m} to lime candle named "&a&l%{_home::%player%::3}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::3}%%nl%&8&l| &fTp into this home by clicking" if {_homes::%player%} is 4: set slot 14 and 15 and 16 of {_m} to red candle named "&c&lᴇᴍᴘᴛʏ ʜᴏᴍᴇ" with lore "&8&l| &7Home is not set!%nl%&8&l| &7You can set it with /home set!" set slot 10 of {_m} to lime candle named "&a&l%{_home::%player%::1}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::1}%%nl%&8&l| &fTp into this home by clicking" set slot 11 of {_m} to lime candle named "&a&l%{_home::%player%::2}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::2}%%nl%&8&l| &fTp into this home by clicking" set slot 12 of {_m} to lime candle named "&a&l%{_home::%player%::3}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::3}%%nl%&8&l| &fTp into this home by clicking" set slot 13 of {_m} to lime candle named "&a&l%{_home::%player%::4}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::4}%%nl%&8&l| &fTp into this home by clicking" if {_homes::%player%} is 5: set slot 15 and 16 of {_m} to red candle named "&c&lᴇᴍᴘᴛʏ ʜᴏᴍᴇ" with lore "&8&l| &7Home is not set!%nl%&8&l| &7You can set it with /home set!" set slot 10 of {_m} to lime candle named "&a&l%{_home::%player%::1}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::1}%%nl%&8&l| &fTp into this home by clicking" set slot 11 of {_m} to lime candle named "&a&l%{_home::%player%::2}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::2}%%nl%&8&l| &fTp into this home by clicking" set slot 12 of {_m} to lime candle named "&a&l%{_home::%player%::3}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::3}%%nl%&8&l| &fTp into this home by clicking" set slot 13 of {_m} to lime candle named "&a&l%{_home::%player%::4}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::4}%%nl%&8&l| &fTp into this home by clicking" set slot 14 of {_m} to lime candle named "&a&l%{_home::%player%::5}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::5}%%nl%&8&l| &fTp into this home by clicking" if {_homes::%player%} is 6: set slot 16 of {_m} to red candle named "&c&lᴇᴍᴘᴛʏ ʜᴏᴍᴇ" with lore "&8&l| &7Home is not set!%nl%&8&l| &7You can set it with /home set!" set slot 10 of {_m} to lime candle named "&a&l%{_home::%player%::1}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::1}%%nl%&8&l| &fTp into this home by clicking" set slot 11 of {_m} to lime candle named "&a&l%{_home::%player%::2}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::2}%%nl%&8&l| &fTp into this home by clicking" set slot 12 of {_m} to lime candle named "&a&l%{_home::%player%::3}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::3}%%nl%&8&l| &fTp into this home by clicking" set slot 13 of {_m} to lime candle named "&a&l%{_home::%player%::4}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::4}%%nl%&8&l| &fTp into this home by clicking" set slot 14 of {_m} to lime candle named "&a&l%{_home::%player%::5}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::5}%%nl%&8&l| &fTp into this home by clicking" set slot 15 of {_m} to lime candle named "&a&l%{_home::%player%::6}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::6}%%nl%&8&l| &fTp into this home by clicking" if {_homes::%player%} is 7: set slot 10 of {_m} to lime candle named "&a&l%{_home::%player%::1}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::1}%%nl%&8&l| &fTp into this home by clicking" set slot 11 of {_m} to lime candle named "&a&l%{_home::%player%::2}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::2}%%nl%&8&l| &fTp into this home by clicking" set slot 12 of {_m} to lime candle named "&a&l%{_home::%player%::3}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::3}%%nl%&8&l| &fTp into this home by clicking" set slot 13 of {_m} to lime candle named "&a&l%{_home::%player%::4}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::4}%%nl%&8&l| &fTp into this home by clicking" set slot 14 of {_m} to lime candle named "&a&l%{_home::%player%::5}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::5}%%nl%&8&l| &fTp into this home by clicking" set slot 15 of {_m} to lime candle named "&a&l%{_home::%player%::6}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::6}%%nl%&8&l| &fTp into this home by clicking" set slot 16 of {_m} to lime candle named "&a&l%{_home::%player%::7}%" with lore "&8&l| &7Location&8: &f%{_location::%player%::7}%%nl%&8&l| &fTp into this home by clicking" if arg 1 is "set" or "ustaw": if arg 2 is set: if player has permission "home.set": loop {_homes::%player%}: if loop-value is 0: set {_name} to arg 2 set {_home::%player%::1} to {_name} set {_pos} to location of player set {_location::%player%::1} to {_pos} set yaml value "Homes.%player%.Home.Name" from "config" to "%{_name}%" set yaml value "Homes.%player%.Home.Name.Location" from "config" to "%{_pos}%" send "&a&l✔ &asᴜᴄᴄᴇsғᴜʟʏ ᴄʀᴇᴀᴛᴇᴅ ʜᴏᴍᴇ" to player set yaml value "Homes.%player%.Count" from "config" to 1 set {_homes::%player%} to 1 add {_name} to {_names::%player%} stop if loop-value is 1: if player has permission "home.max.2": set {_name} to arg 2 set {_home::%player%::2} to {_name} set {_pos} to location of player set {_location::%player%::2} to {_pos} set yaml value "Homes.%player%.Home2.Name" from "config" to "%{_name}%" set yaml value "Homes.%player%.Home2.Name.Location" from "config" to "%{_pos}%" send "&a&l✔ &asᴜᴄᴄᴇsғᴜʟʏ ᴄʀᴇᴀᴛᴇᴅ ʜᴏᴍᴇ" to player set yaml value "Homes.%player%.Count" from "config" to 2 set {_homes::%player%} to 2 add {_name} to {_names::%player%} stop else: send "&c&l✘ &cʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ʏᴏᴜʀ ʟɪᴍɪᴛ, ʙᴜʏ ʙᴇᴛᴛᴇʀ ʀᴀɴᴋ ғᴏʀ ᴍᴏʀᴇ ʜᴏᴍᴇs" to player if loop-value is 2: if player has permission "home.max.3": set {_name} to arg 2 set {_home::%player%::3} to {_name} set {_pos} to location of player set {_location::%player%::3} to {_pos} set yaml value "Homes.%player%.Home3.Name" from "config" to "%{_name}%" set yaml value "Homes.%player%.Home3.Name.Location" from "config" to "%{_pos}%" send "&a&l✔ &asᴜᴄᴄᴇsғᴜʟʏ ᴄʀᴇᴀᴛᴇᴅ ʜᴏᴍᴇ" to player set yaml value "Homes.%player%.Count" from "config" to 3 set {_homes::%player%} to 3 add {_name} to {_names::%player%} stop else: send "&c&l✘ &cʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ʏᴏᴜʀ ʟɪᴍɪᴛ, ʙᴜʏ ʙᴇᴛᴛᴇʀ ʀᴀɴᴋ ғᴏʀ ᴍᴏʀᴇ ʜᴏᴍᴇs" to player if loop-value is 3: if player has permission "home.max.4": set {_name} to arg 2 set {_home::%player%::4} to {_name} set {_pos} to location of player set {_location::%player%::4} to {_pos} set yaml value "Homes.%player%.Home4.Name" from "config" to "%{_name}%" set yaml value "Homes.%player%.Home4.Name.Location" from "config" to "%{_pos}%" send "&a&l✔ &asᴜᴄᴄᴇsғᴜʟʏ ᴄʀᴇᴀᴛᴇᴅ ʜᴏᴍᴇ" to player set yaml value "Homes.%player%.Count" from "config" to 4 set {_homes::%player%} to 4 add {_name} to {_names::%player%} stop else: send "&c&l✘ &cʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ʏᴏᴜʀ ʟɪᴍɪᴛ, ʙᴜʏ ʙᴇᴛᴛᴇʀ ʀᴀɴᴋ ғᴏʀ ᴍᴏʀᴇ ʜᴏᴍᴇs" to player if loop-value is 4: if player has permission "home.max.5": set {_name} to arg 2 set {_home::%player%::5} to {_name} set {_pos} to location of player set {_location::%player%::5} to {_pos} set yaml value "Homes.%player%.Home5.Name" from "config" to "%{_name}%" set yaml value "Homes.%player%.Home5.Name.Location" from "config" to "%{_pos}%" send "&a&l✔ &asᴜᴄᴄᴇsғᴜʟʏ ᴄʀᴇᴀᴛᴇᴅ ʜᴏᴍᴇ" to player set yaml value "Homes.%player%.Count" from "config" to 5 set {_homes::%player%} to 5 add {_name} to {_names::%player%} stop else: send "&c&l✘ &cʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ʏᴏᴜʀ ʟɪᴍɪᴛ, ʙᴜʏ ʙᴇᴛᴛᴇʀ ʀᴀɴᴋ ғᴏʀ ᴍᴏʀᴇ ʜᴏᴍᴇs" to player if loop-value is 5: if player has permission "home.max.6": set {_name} to arg 2 set {_home::%player%::6} to {_name} set {_pos} to location of player set {_location::%player%::6} to {_pos} set yaml value "Homes.%player%.Home6.Name" from "config" to "%{_name}%" set yaml value "Homes.%player%.Home6.Name.Location" from "config" to "%{_pos}%" send "&a&l✔ &asᴜᴄᴄᴇsғᴜʟʏ ᴄʀᴇᴀᴛᴇᴅ ʜᴏᴍᴇ" to player set yaml value "Homes.%player%.Count" from "config" to 6 set {_homes::%player%} to 6 add {_name} to {_names::%player%} stop else: send "&c&l✘ &cʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ʏᴏᴜʀ ʟɪᴍɪᴛ, ʙᴜʏ ʙᴇᴛᴛᴇʀ ʀᴀɴᴋ ғᴏʀ ᴍᴏʀᴇ ʜᴏᴍᴇs" to player if loop-value is 6: if player has permission "home.max.7": set {_name} to arg 2 set {_home::%player%::7} to {_name} set {_pos} to location of player set {_location::%player%::7} to {_pos} set yaml value "Homes.%player%.Home7.Name" from "config" to "%{_name}%" set yaml value "Homes.%player%.Home7.Name.Location" from "config" to "%{_pos}%" send "&a&l✔ &asᴜᴄᴄᴇsғᴜʟʏ ᴄʀᴇᴀᴛᴇᴅ ʜᴏᴍᴇ" to player set yaml value "Homes.%player%.Count" from "config" to 7 set {_homes::%player%} to 7 add {_name} to {_names::%player%} stop else: send "&c&l✘ &cʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ʏᴏᴜʀ ʟɪᴍɪᴛ, ʙᴜʏ ʙᴇᴛᴛᴇʀ ʀᴀɴᴋ ғᴏʀ ᴍᴏʀᴇ ʜᴏᴍᴇs" to player if loop-value is 7: send "&c&l✘ &cʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ʏᴏᴜʀ ʟɪᴍɪᴛ ᴏғ ᴀᴠᴀɪʟᴀʙʟᴇ ʜᴏᴜsᴇs! ᴅᴇʟᴇᴛᴇ sᴏᴍᴇ ғɪʀsᴛ." to player stop else: send "&c&l✘ &cʏᴏᴜ ᴅᴏɴᴛ ʜᴀᴠᴇ ᴘᴇʀᴍɪssɪᴏɴs" to player else: send "&c&l✘ &csᴘᴇᴄɪғʏ ʜᴏᴍᴇ ɴᴀᴍᴇ" to player if arg 1 is "rem" or "remove" or "usun": if arg 2 is set: set {_name} to arg 2 if player has permission "home.remove": loop {_names::%player%}: if loop-value is {_name}: send "&a&l✔ &asᴜᴄᴄᴇsғᴜʟʏ ᴅᴇʟᴇᴛᴇᴅ ʜᴏᴍᴇ" on first join: set yaml value "Homes.%player%.Count" from "config" to 0 on inventory click: event-inventory is not player's inventory if name of event-inventory is "&a&lᴜʟᴛɪᴍᴀᴛᴇ ʜᴏᴍᴇs": cancel event if clicked slot is 10: if {_home::%player%::1} is set: close player's inventory send "&a&l✔ &aᴛᴇʟᴇᴘᴏʀᴛᴇᴅ!" to player teleport player to {_location::%player%::1} stop if clicked slot is 11: if {_home::%player%::2} is set: close player's inventory send "&a&l✔ &aᴛᴇʟᴇᴘᴏʀᴛᴇᴅ!" to player teleport player to {_location::%player%::2} stop if clicked slot is 12: if {_home::%player%::3} is set: close player's inventory send "&a&l✔ &aᴛᴇʟᴇᴘᴏʀᴛᴇᴅ!" to player teleport player to {_location::%player%::3} stop if clicked slot is 13: if {_home::%player%::4} is set: close player's inventory send "&a&l✔ &aᴛᴇʟᴇᴘᴏʀᴛᴇᴅ!" to player teleport player to {_location::%player%::4} stop if clicked slot is 14: if {_home::%player%::5} is set: close player's inventory send "&a&l✔ &aᴛᴇʟᴇᴘᴏʀᴛᴇᴅ!" to player teleport player to {_location::%player%::5} stop if clicked slot is 15: if {_home::%player%::6} is set: close player's inventory send "&a&l✔ &aᴛᴇʟᴇᴘᴏʀᴛᴇᴅ!" to player teleport player to {_location::%player%::6} stop if clicked slot is 16: if {_home::%player%::7} is set: close player's inventory send "&a&l✔ &aᴛᴇʟᴇᴘᴏʀᴛᴇᴅ!" to player teleport player to {_location::%player%::7} stop