# ScriptClan

This class corresponds to a clan within the game and provides information related to the specific clan.

## Method <a href="#undefined" id="undefined"></a>

| form                           | explanation                                              |
| ------------------------------ | -------------------------------------------------------- |
| DateTime createdAt { get; }    | This is when the clan was created.                       |
| long id { get; }               | This is the unique ID of the clan.                       |
| long masterPlayerID { get; }   | This is the ID of the clan master player.                |
| long\[] memberIDs { get; }     | Gets the IDs of all members of the clan in array format. |
| Table customData { get; set; } | This is the clan's custom data.                          |
| string name { get; }           | The unique name of the clan.                             |

## Function <a href="#undefined" id="undefined"></a>

| form                          | explanation                                                     |
| ----------------------------- | --------------------------------------------------------------- |
| string GetMemberName(long id) | Get the name of the user whose ID is id among the clan members. |
| void Invalidate()             | Update clan information.                                        |

## Example <a href="#undefined" id="undefined"></a>

### Print when the clan was created

{% code overflow="wrap" lineNumbers="true" %}

```
local myClan = unit.player.clan; 
print(myClan.createdAt.ToLocalTime());
```

{% endcode %}

### Print out the clan ID

{% code overflow="wrap" lineNumbers="true" %}

```
local myClan = unit.player.clan; 
print(myClan.id);
```

{% endcode %}

### Print all clan members' IDs

{% code overflow="wrap" lineNumbers="true" %}

```
local memberIDs = unit.player.clan.memberIDs;

for i = 0, #memberIDs do
  print(memberIDs[i]);
end
```

{% endcode %}

### Print the clan name

{% code lineNumbers="true" %}

```
local myClan = unit.player.clan;
print(myClan.name);
```

{% endcode %}


---

# 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.punkland.io/punkland-studio/script/server-script/scriptclan.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.
