on load: if folder "plugins/MrChatControl" doesn't exists: create folder "plugins/MrChatControl" if file "plugins/MrChatControl/Messages.yml" doesn't exists: create file "plugins/MrChatControl/Messages.yml" set yaml value "ChatClearMessage" from file "plugins/MrChatControl/Messages.yml" to "&a&lChat zostal wyczyszczony!" set yaml value "ChatClearOn" from file "plugins/MrChatControl/Messages.yml" to "&a&lChat zostal wlaczony!" set yaml value "ChatClearOff" from file "plugins/MrChatControl/Messages.yml" to "&a&lChat zostal wylaczony!" set yaml value "ChatOffline" from file "plugins/MrChatControl/Messages.yml" to "&8>>> &aChat jest wylaczony!" set {ChatClearMessage} to yaml value "ChatClearMessage" from file "plugins/MrChatControl/Messages.yml" set {ChatClearOn} to yaml value "ChatClearOn" from file "plugins/MrChatControl/Messages.yml" set {ChatClearOff} to yaml value "ChatClearOff" from file "plugins/MrChatControl/Messages.yml" set {ChatOffline} to yaml value "ChatOffline" from file "plugins/MrChatControl/Messages.yml" variables: {chat.status} = true command /MrChatControl []: aliases: mrcc trigger: if arg isn't set: open chest with 1 rows named "&a&lMrChatControl" to player set slot 3 of current inventory of player to orange wool named "&a&lChat Clear" with lore "&7Wyczysc Chat" if {chat.status} = true: set slot 5 of current inventory of player to red wool named "&a&lChat Off" with lore "&7Wylacz Chat" else: set slot 5 of current inventory of player to green wool named "&a&lChat On" with lore "&7Wlacz Chat" if arg is "clear": loop 100 times: send "" to players send "%{ChatClearMessage}%" to players if arg is "on": if {chat.status} is false: set {chat.status} to true send "%{ChatClearOn}%" to players if arg is "off": if {chat.status} is true: set {chat.status} to false send "%{ChatClearOff}%" to players on chat: if {chat.status} is false: send "%{ChatOffline}%" cancel event on inventory click: if inventory name of current inventory of player is "&a&lMrChatControl": if clicked slot is 3: close player's inventory make player execute "mrcc clear" cancel event if clicked slot is 5: if {chat.status} = true: close player's inventory make player execute "mrcc off" cancel event else: close player's inventory make player execute "mrcc on" cancel event