Exports

Tree Generator client exports: read, add or drop the logs a player carries, and find the zone a player is standing in.

All exports are client-side.

ExportParametersWhat it does
getHeldLogsnoneReturns the list of log objects the player is carrying
dropHeldLogscount, destroyDrops that many logs. With destroy = true they are deleted instead of dropped
addHeldLogslogsMakes the player carry these log objects (for example from getHeldLogs)
getInsideZonenoneReturns the zone the player is standing in, or nil

Example: sell carried logs

lua
local logs = exports['fz-foliage']:getHeldLogs()

if #logs > 0 then
    exports['fz-foliage']:dropHeldLogs(#logs, true) -- take them away
    TriggerServerEvent('myjob:sellLogs', #logs)       -- pay the player in your own script
end

Still stuck?Ask on our Discord