Skip to main content

UI

You can create custom inventories that act as UI quickly and simply

Functions

  • createUI(title, size, placeholder, buttons) - creates a new UI
  • showUI(player, ui) - opens the UI
  • closeUI(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)