> ## Documentation Index
> Fetch the complete documentation index at: https://lationscripts.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Weed - Exports - Server

> All exports available on the server

### addPlayerData

Adds an amount to a player's specified data field (handles exp → level recalculation).

```lua theme={null}
exports.lation_weed:addPlayerData(source, type, amount)
```

<ParamField path="source" type="number" required>
  The source (*player ID*) to add data to.
</ParamField>

<ParamField path="type" type="string" required>
  The data type to modify (e.g., `"exp"`, `"joints_rolled"`, `"plants_grown"`).
</ParamField>

<ParamField path="amount" type="number" required>
  The amount to add to the specified data type.
</ParamField>

### getLevelData

Returns the configured experience/level table (level thresholds and rewards).

```lua theme={null}
local levels = exports.lation_weed:getLevelData()
```

### getPlayerPlantCount

Returns the number of plants a player currently owns.

```lua theme={null}
local count = exports.lation_weed:getPlayerPlantCount(source)
```

<ParamField path="source" type="number" required>
  The source (*player ID*) to count plants for.
</ParamField>

### getPlantData

Returns data for a single plant. Pass a property to retrieve a single field, or omit it to receive a copy of the full plant row (never the live cache).

```lua theme={null}
exports.lation_weed:getPlantData(plantId, property)
```

<ParamField path="plantId" type="number" required>
  The plant's unique ID.
</ParamField>

<ParamField path="property" type="string">
  A specific field to retrieve (e.g., `"growth"`, `"health"`, `"stage"`, `"bucketId"`). If omitted, returns the full plant table.
</ParamField>

### getAllPlants

Returns every plant on the server, keyed by plant ID. Each entry is a copy, so mutating the result won't affect live plant data.

```lua theme={null}
local plants = exports.lation_weed:getAllPlants()
```

### purchaseLab

Purchases (or grants) a lab for a player. Use this to build your own lab-purchasing flow. Eligibility is still enforced (the lab must exist, the player must meet the level requirement, be under the per-player cap, and the lab must not already be owned).

```lua theme={null}
exports.lation_weed:purchaseLab(source, labKey, options)
```

<ParamField path="source" type="number" required>
  The source (*player ID*) to assign the lab to. Must be online.
</ParamField>

<ParamField path="labKey" type="string" required>
  The lab's config key — the same keys defined in your labs config (e.g., `"mission_row_1"`).
</ParamField>

<ParamField path="options" type="table">
  Optional. Pass `{ skipPayment = true }` to grant the lab without charging the player, so you can handle payment your own way. Defaults to charging the configured price.
</ParamField>

Returns a table:

```lua theme={null}
{ ok = true, labId = 12 }
-- or on failure
{ ok = false, error = "insufficient-funds" }
```

### getLabBalance

Returns the current wallet balance of a lab.

```lua theme={null}
local balance = exports.lation_weed:getLabBalance(labId)
```

<ParamField path="labId" type="number" required>
  The lab's numeric ID (assigned on purchase).
</ParamField>

<Note>
  Looking for an export we don't have listed here? Contact us and we'll do what we can!
</Note>
