UI
You can create custom inventories that act as UI quickly and simply
Functions
createUI(title, size, placeholder, buttons)- creates a new UIshowUI(player, ui)- opens the UIcloseUI(player)- closes the UI
Example
local ui = createUI {
title = "My Custom UI",
size = 27,
placeholder = {
material = "GRAY_STAINED_GLASS_PANE",
label = " "
},
buttons = {
[13] = {
material = "EMERALD",
label = "Click me!",
onClick = function()
player:sendMessage("§a$100 has been added to your balance!")
eco:addBalance(playerName, 100)
-- closeUI(player)
end
},
[16] = {
material = "DIAMOND",
label = "Click me!",
onClick = function()
player:sendMessage("You clicked the diamond button!")
closeUI(player)
end
}
}
}
showUI(player, ui)