> 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

docs for the sigma exploit api

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

```
