# Documentation

## Project Finity Library

Project Finity has a variety of different modules for you to customize your cheat. Below is the documentation on how to use each of them.\
\
Note: this documentation isn't the best.

### Finity (Pseudo-Instance)

```lua
local Finity = loadstring(game:HttpGet("http://finity.vip/scripts/finity_lib.lua"))()
```

Use the above line of code before you run any of Project Finity's UI methods.

{% tabs %}
{% tab title="Constructors" %}

| Constructor                             | Description                           | Return Types |
| --------------------------------------- | ------------------------------------- | :----------: |
| Finity.new(\[, boolean is\_dark\_mode]) | Creates a new Finity pseudo-instance. | FinityWindow |
| {% endtab %}                            |                                       |              |

{% tab title="Properties" %}

| Property       | Default Value              |
| -------------- | -------------------------- |
| is\_dark\_mode | **false**                  |
| toggle\_key    | Enum.KeyCode.**Semicolon** |
| {% endtab %}   |                            |
| {% endtabs %}  |                            |

### FinityWindow

```lua
local FinityWindow = Finity.new(true) -- 'true' means dark mode is enabled
```

A FinityWindow is essentially the main backbone of the UI.

{% tabs %}
{% tab title="Methods" %}

| Method                                          | Description                               |  Return Types  |
| ----------------------------------------------- | ----------------------------------------- | :------------: |
| FinityWindow:Category(string name)              | Creates a new FinityCategory with a name. | FinityCategory |
| FinityWindow\.ChangeToggleKey(**Enum** keycode) | Changes the key to toggle the window.     |       nil      |

{% hint style="info" %}
Because of the way Finity works, multiple categories with the same name are allowed, *however*, it may be confusing for your users.
{% endhint %}
{% endtab %}
{% endtabs %}

### FinityCategory

```lua
local FinityCategory = FinityWindow:Category("name") -- name is the name of the FinityCategory
```

A FinityCategory is an easy and dynamic way to categorize the modules of the script you're making into general categories.&#x20;

For example, let's say I was making a cheat for Apocalypse Rising 2: I would be able to use multiple FinityCategory instances to be able to categorize different types of cheats, such as Visuals, Guns, Items, Zombies, and/or Client cheat. You get the idea, right? Cool beans!

Below are the methods of a FinityCategory.

{% tabs %}
{% tab title="Methods" %}

| Method                                 | Description                             | Return Types |
| -------------------------------------- | --------------------------------------- | :----------: |
| FinityCategory:Sector(**string** name) | Creates a new FinitySector with a name. | FinitySector |

{% hint style="info" %}
Because of the way Finity works, multiple sectors with the same name are allowed, *however*, it may be confusing for your users. Less confusing than duplicate categories, I hope. :sweat\_smile:&#x20;
{% endhint %}
{% endtab %}

{% tab title="Properties" %}

| Property      | Default Value |
| ------------- | ------------- |
| name          | **nil**       |
| {% endtab %}  |               |
| {% endtabs %} |               |

### FinitySector

```lua
local FinitySector = FinityCategory:Sector("name") -- name is the name of the FinityCategory
```

A FinitySector instance is essentially a mini-category, allowing for even more categorization.&#x20;

For example, it would allow you to sub-categorize a "Visuals" category into things like "Player Visuals," "Zombie Visuals," and "Item Visuals."

Below are the methods associated with a FinitySector.

{% tabs %}
{% tab title="Methods" %}

| Method                                                                                           | Description                                                                            | Return Types |
| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | :----------: |
| FinitySector:Cheat(**string** type, **string** name \[, **function** callback,  **array** data]) | Creates a new FinityCheat with a type and a name. (Optional: callback function & data) |  FinityCheat |
| {% endtab %}                                                                                     |                                                                                        |              |

{% tab title="Properties" %}

| Property      | Default Value |
| ------------- | ------------- |
| name          | **nil**       |
| {% endtab %}  |               |
| {% endtabs %} |               |

### FinityCheat

```lua
local FinityCheat = FinitySector:Cheat("type", "name", function (NewValue)
    print(NewValue)
end, {})
```

A FinityCheat is a cheat modules useful for hooking callbacks to toggles in order to have a smooth and organized script.

There are many different types of cheat modules. Here's a table to compare them all:

| Cheat Module Type | Description                                                                                                                            |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Checkbox          | The checkbox is useful for having a user control the state of something. Fires callback with the new state of the checkbox.            |
| Dropdown          | The dropdown is useful for having a user choose from a list of things. Fires the callback with the option that was chosen as a string. |
| Slider            | The slider is useful for having a user choose between a range of numbers. Fires the callback with the new value of the slider.         |
| Textbox           | The textbox is useful for having the user enter a custom value. Fires the callback with the new value of the textbox as a string.      |
| Button            | The button is nice for a user to trigger a specific action. Fires the callback when clicked with no arguments.                         |
| Keybind           | The keybind is useful for performing an action when a key is pressed. Fires the callback when the key is changed or pressed.           |
| Colorpicker       | This is nice for choosing a certain color in range. Fires the callback each time the color is changed with the new Color3.             |
| Label             | The label is useful for displaying information to a user. Doesn't fire anything.                                                       |

## Resources

[V3rmillion.net Thread](https://v3rmillion.net/showthread.php?tid=922755)\
[Introduction](/project-finity/master.md)\
[Getting Started](/project-finity/tutorials/tutorial.md)\
[Source](http://finity.vip/scripts/finity_lib.lua)\
[Discord Server](https://discordapp.com/invite/Egc89fh)


---

# 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://detourious.gitbook.io/project-finity/docs.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.
