This document outlines all available exports and events as well as any advanced customization within the luxu_admin resource.
You can create custom logic for zones.
📂luxu_admin/config/custom_functions/client.lua
Example
--- Zone Handler
---@class Zone
---@field id string
---@field points [number, number][]
---@field rgba {r: number, g: number, b: number, a: number}
---@field debug boolean
---@field name string
---@field customHandler string
---@field metadata table
---@field height number
--- Register a zone handler
--- The zone name must be unique and is not related to the actual zone created, this is just the handler name, it can be used by multiple zones
RegisterZoneHandler("zone_handler_unique_name", function()
---@param zone Zone
local function onEnter(zone)
print("You entered a custom zone", zone.name)
end
---@param zone Zone
local function onExit(zone)
print("You exited a custom zone", zone.name)
end
---@param zone Zone
local function inside(zone)
print("You are inside a custom zone", zone.name)
end
return {
onEnter = onEnter,
onExit = onExit,
inside = inside,
} --[[ @as {onEnter: function | nil, onExit: function | nil, inside: function | nil} ]]
--[[
-- More info about the zone object:
-- If you don't use some of the callbacks, you can return nil for them (recommended)
return {
onEnter = onEnter,
onExit = nil,
inside = nil,
}
]]
end)