> ## 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 - Shared

> Data available on both the client and server

### getPlayerData

Retrieves a player's weed data. Optionally pass a key to get a single field; omit it to get the full table.

On the **server** this is an export. On the **client** the same data is retrieved through a callback (the client has no player `source` to pass).

<Tabs>
  <Tab title="Client">
    ```lua theme={null}
    local data = lib.callback.await('lation_weed:GetPlayerData', false, key)
    ```

    <ParamField path="key" type="string">
      The specific player data field you want to retrieve (e.g., `"level"`, `"exp"`, `"plants_grown"`). If omitted, returns a table with all player data.
    </ParamField>
  </Tab>

  <Tab title="Server">
    ```lua theme={null}
    exports.lation_weed:getPlayerData(source, key)
    ```

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

    <ParamField path="key" type="string">
      The specific player data field you want to retrieve (e.g., `"level"`, `"exp"`, `"plants_grown"`). If omitted, returns a table with all player data.
    </ParamField>
  </Tab>
</Tabs>

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