luckyscripts.DOCUMENTATION
LuckyScripts / Quick ActionsFIVEM FIELD GUIDE

Actions & framework integration

Actions & framework integration guide for LuckyScripts Quick Actions.

Check the example against your release

The original guide shows an export action with an equals sign while the callback example parses a colon. Check the action format in your downloaded resource before connecting exports.

1. client_event

Triggers client-side events.

{ id = "stats", label = "Stats", type = "client_event", action = "openStats" }
-- Triggers: RegisterNetEvent('openStats')

2. server_event

Triggers server-side events.

{ id = "id", label = "Show ID", type = "server_event", action = "showId" }
-- Triggers: TriggerServerEvent('showId')

3. command

Executes FiveM chat commands.

{ id = "inv", label = "Inventory", type = "command", action = "inventory" }
-- Executes: ExecuteCommand('inventory')

4. export

Calls an export from another resource.

{ id = "ems", label = "EMS Menu", type = "export", action = "ems=openMenu" }
-- Calls: exports['ems']['openMenu']()

Listening to Client Events

Using RegisterNetEvent

-- Door events example
RegisterNetEvent('doors:all', function()
    -- Open all doors
end)

RegisterNetEvent('doors:driver', function()
    -- Open driver door
end)

Using NUI Callback

RegisterNUICallback('actionClick', function(data, cb)
    -- data.id    = Item ID
    -- data.type  = Event type
    -- data.action = Action string
    
    if data.type == "client_event" then
        TriggerEvent(data.action)
    elseif data.type == "server_event" then
        TriggerServerEvent(data.action)
    elseif data.type == "command" then
        ExecuteCommand(data.action)
    elseif data.type == "export" then
        local resource, exportName = string.match(data.action, "([^:]+):([^:]+)")
        if resource and exportName then
            exports[resource][exportName]()
        end
    end
    
    cb('ok')
end)

Framework Integration (bridge/framework.lua)

The system works with existing framework integration. Player job is retrieved via Bridge.GetPlayerJob().

Edit bridge/framework.lua for your own framework.

LuckyScripts Quick Actions · Match configuration examples to your downloaded release.
Need a hand? Read the support guide ↗

On this page