Exports
Tree Generator client exports: read, add or drop the logs a player carries, and find the zone a player is standing in.
Updated View Tree Generator in the store
All exports are client-side.
| Export | Parameters | What it does |
|---|---|---|
getHeldLogs | none | Returns the list of log objects the player is carrying |
dropHeldLogs | count, destroy | Drops that many logs. With destroy = true they are deleted instead of dropped |
addHeldLogs | logs | Makes the player carry these log objects (for example from getHeldLogs) |
getInsideZone | none | Returns 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
endStill stuck?Ask on our Discord