# Exports function

{% code title="client - side" %}

```lua
local isHasParty = exports['zobyeteam_party']:isHasParty()
```

{% endcode %}

Function นี้จะมีการคืนค่าว่าผู้เล่นคนนี้อยู่ใน party หรือไม่ ถ้าใช่จะคืนค่าเป็น true ถ้าไม่จะเป็น false

{% code title="client - side" %}

```lua
local targetGive = exports['zobyeteam_party']:getTargetGive(isCheckDistance)

--isCheckDistance - boolean
```

{% endcode %}

Function นี้จะมีการคืนค่าเป็น server id ของผู้เล่นที่ผู้เล่นคนนี้เลือกจะให้ของแทนตนเอง โดยรับ Argument 1 ตัวคือ isCheckDistance (เช็คระยะตามที่ตั้งไว้ใน Config.maxDistance หรือไม่)

{% code title="client - side" %}

```lua
local partyMemberCount = exports['zobyeteam_party']:getPartyMemberCount()
```

{% endcode %}

Function นี้จะมีการคืนค่าเป็นจำนวนผู้เล่นใน party ของผู้เล่นนั้นๆ และจะนับเฉพาะผู้เล่นที่อยู่ในระยะตาม Config.maxDistance หากปรับให้ Config.countOnlyClosePlayer = true

ถ้าหากไม่ได้อยู่ใน party จะคืนค่าเป็น 0

```lua
-- client - side
exports['zobyeteam_party']:addInventoryItem(itemName, amount, isCheckDistance)

-- server - side
exports['zobyeteam_party']:addInventoryItem(playerId, itemName, amount, isCheckDistance)

--itemName - string
--amount - number
--isCheckDistance - boolean
```

Function นี้จะไม่มีการคืนค่าใดๆแต่จะเป็นการ Add ไอเทมให้กับ Target Give(ผู้เล่นที่เลือกที่จะให้ของ)             สำหรับฝั่ง client รับ argument เข้าไป 3 ตัวได้แก่ itemName(ชื่อไอเทม) amount(จำนวนที่ต้องการ) และ isCheckDistance(เช็คระยะตามที่ตั้งไว้ใน Config.maxDistance หรือไม่) ส่วนฝั่ง server มีการรับ argument 4 ตัว โดยเพิ่ม playerId ของผู้เล่นคนนั้นๆเข้ามา

{% code title="client - side" %}

```lua
exports['zobyeteam_party']:openParty()
```

{% endcode %}

Function นี้จะไม่มีการคืนค่าใดๆแต่จะเป็นการเปิดหน้า Interface ของ party ในกรณีที่ลูกค้าอาจจะนำไปเชื่อมกับเมนูเพื่อเลือกเปิด party โดยไม่กดปุ่มที่ตั้งไว้ใน Config

<pre class="language-lua" data-title="client - side"><code class="lang-lua"><strong>local partyMembers = exports['zobyeteam_party']:getPartyMembers(maxDistance)
</strong>
-- maxDistance - number
</code></pre>

Function นี้จะ return table ของสมาชิกใน party ที่อยู่ในระยะของ maxDistance หรือ Config.maxDistance หากไม่ระบุ maxDistance เมื่อปรับ Config.countOnlyClosePlayer = true\
แต่ถ้าหากปรับ Config.countOnlyClosePlayer = false จะ return สมาชิกทั้งหมดใน party

{% code title="client - side" %}

```lua
local isPartyHeader = exports['zobyeteam_party']:getIsPartyHeader()
```

{% endcode %}

return boolean (true-false) ว่าผู้เล่นที่ client นี้เป็นหัวหน้า party หรือไม่

{% code title="client - side" %}

```lua
local isPartyHeader = exports['zobyeteam_party']:getPartyName()
```

{% endcode %}

return ชื่อของ party ที่ผู้เล่นอยู่

{% code title="server - side" %}

```lua
exports['zobyeteam_party']:addPartyExp(playerId, exp)
```

{% endcode %}

ใช้สำหรับ add exp ให้กับ party ของผู้เล่น โดยระบุ playerId และ exp


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zobyeteam.com/resource/zobyeteam_party/connection/exportsfunction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
