fetchFarm
exports['RiP-Weed']:fetchFarm(farmId)
This function fetches the current farm's data
Arguments
Name | Type | Optional | Explenation |
---|---|---|---|
farmId | Integer | Yes | Farm id |
Returned Object
Returns table of all farms if farmId
= nil
Name | Type | Explenation |
---|---|---|
id | Integer | Farm (config) id |
owner | String | Farm's owner (identifier or job -name) |
balance | Integer | Farm's money |
total_sales | Integer | Farm's all-time money |
stats | Array | Farm's harvest stats |
plants | Array | Farm's plants |
storage | Array | Farm's storage |
crafter | Array | Farm's crafting queue |
upgrades | Array | Farm's upgrades |
visitor | Array | All player id's currently in the farm |
false
on error
Example
local farmData = exports['RiP-Weed']:fetchFarm(1)
for r,p in pairs(farmData.visitor) do
print("player "..p.." is currently inside the farm")
end