> For the complete documentation index, see [llms.txt](https://apidocs.pxsta.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.pxsta.xyz/docs.md).

# Docs

## general stuff

**loading the client**

```lua
local client = loadstring(game:HttpGet('https://exploitsapi.pxsta.xyz/client'))()
```

**starting the client**

```lua
client.connect('user_id', 'hub_id')
```

**toggle joins (allowing other users to join you)**

```lua
client.allowJoins(state) -- default is false
```

**disconnecting from api**

```lua
client.disconnect()
```

## chat

after calling `client.connect` `client.messages` will contain the past 500 messages sent, this table will be auto updated

**message format**

```lua
{
    time = 0, -- unix time, in ms
    text = 'message content',
    user = 'name of the message author'
}
```

**sending messages**

```lua
client.sendMessage('text')
```

**on message sent**

```lua
client.onMessageReceive:Connect(function(message)
    print(message.user .. ': ' .. message.text)
end)
```

## users

after calling `client.connect` `client.users` will be a dictionary of `{ name: user }` containing every user, this dictionary will be auto updated

**user format**

```lua
{
    name = 'username',
    discord_id = 'discord id',
    online = true,
    hub = 'hub name, or null if user is offline'
}
```

**on user update**

```lua
client.onUserUpdate:Connect(function(user)
    print(user.name .. '\'s data changed' )
end)
```

**get users server**

```lua
local success, data = client.requestServer('username')

if not success then print('failed to get server, reason:', data)
else print('game:', data.place_id .. ', jobId:', data.job_id) end

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://apidocs.pxsta.xyz/docs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
