-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.sk
33 lines (30 loc) · 4.98 KB
/
menu.sk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# ██████╗░██╗░░░██╗██╗░░░██╗░█████╗░██████╗░░█████╗░███████╗████████╗ ██╗░░░░░░█████╗░██╗░░░██╗███████╗████████╗
# ██╔══██╗██║░░░██║╚██╗░██╔╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝ ██║░░░░░██╔══██╗██║░░░██║██╔════╝╚══██╔══╝
# ██████╦╝██║░░░██║░╚████╔╝░██║░░╚═╝██████╔╝███████║█████╗░░░░░██║░░░ ██║░░░░░███████║╚██╗░██╔╝█████╗░░░░░██║░░░
# ██╔══██╗██║░░░██║░░╚██╔╝░░██║░░██╗██╔══██╗██╔══██║██╔══╝░░░░░██║░░░ ██║░░░░░██╔══██║░╚████╔╝░██╔══╝░░░░░██║░░░
# ██████╦╝╚██████╔╝░░░██║░░░╚█████╔╝██║░░██║██║░░██║██║░░░░░░░░██║░░░ ███████╗██║░░██║░░╚██╔╝░░███████╗░░░██║░░░
# ╚═════╝░░╚═════╝░░░░╚═╝░░░░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░░░░░░░╚═╝░░░ ╚══════╝╚═╝░░╚═╝░░░╚═╝░░░╚══════╝░░░╚═╝░░░
# ░█████╗░███████╗ ██╗░░░██╗░█████╗░██████╗░░█████╗░███████╗███████╗███╗░░██╗
# ██╔══██╗██╔════╝ ╚██╗░██╔╝██╔══██╗██╔══██╗██╔══██╗╚════██║██╔════╝████╗░██║
# ███████║█████╗░░ ░╚████╔╝░██║░░██║██║░░██║███████║░░███╔═╝█████╗░░██╔██╗██║
# ██╔══██║██╔══╝░░ ░░╚██╔╝░░██║░░██║██║░░██║██╔══██║██╔══╝░░██╔══╝░░██║╚████║
# ██║░░██║██║░░░░░ ░░░██║░░░╚█████╔╝██████╔╝██║░░██║███████╗███████╗██║░╚███║
# ╚═╝░░╚═╝╚═╝░░░░░ ░░░╚═╝░░░░╚════╝░╚═════╝░╚═╝░░╚═╝╚══════╝╚══════╝╚═╝░░╚══╝
function buycraft(player: player,type: string = 1st element of (yml node keys "Menues" from "plugins/Skript/YAML/Buycraft/Config.yml")):
set (metadata "Buycraft_Type" of {_player}) to {_type}
set {_title} to (1st element of placeholder_replace((yml value "Menues.%{_type}%.Title" from "plugins/Skript/YAML/Buycraft/Config.yml"),{_player}))
set {_rows} to (yml value "Menues.%{_type}%.Rows" from "plugins/Skript/YAML/Buycraft/Config.yml")
set (metadata "Buycraft" of {_player}) to chest inventory with {_rows} rows named {_title}
loop (yml node keys "Menues.%{_type}%.Items" from "plugins/Skript/YAML/Buycraft/Config.yml"):
set {_Slots::*} to (yml list "%loop-node%.Slots" from "plugins/Skript/YAML/Buycraft/Config.yml")
set {_item} to (yml value "%loop-node%.Item" from "plugins/Skript/YAML/Buycraft/Config.yml")
set {_title} to (1st element of (placeholder_replace((colored (yml value "%loop-node%.Title" from "plugins/Skript/YAML/Buycraft/Config.yml")),{_player})))
set {_lore::*} to placeholder_replace((colored (yml list "%loop-node%.Lore" from "plugins/Skript/YAML/Buycraft/Config.yml")),{_player})
set {_i} to ({_item} parsed as item)
if {_i} = player head:
set {_value} to (yml value "%loop-node%.Value" from "plugins/Skript/YAML/Buycraft/Config.yml")
set {_i} to getHead("%{_value}%")
else if {_item} = "player's head" or "player's skull":
set {_i} to {_player}'s skull
set Slots {_Slots::*} of (metadata "Buycraft" of {_player}) to {_i} named {_title} with lore {_lore::*}
open (metadata "Buycraft" of {_player}) to {_player}