# FAQ

## 🚀 Getting Started

<details>

<summary>What is InfinityUI?</summary>

InfinityUI is a **development framework** for creating advanced, customizable menus in FiveM. It's not a plug-and-play script but a tool for developers to build their own menu systems.

</details>

<details>

<summary>Is InfinityUI a complete script?</summary>

**No.** InfinityUI is a **framework/library**. You need to:

* Write your own scripts that use InfinityUI
* Or adapt existing scripts to use InfinityUI

Think of it like a toolbox for building menus.

</details>

<details>

<summary>What's included in InfinityUI?</summary>

Included:

* ✅ Core menu framework (`ui.lua`)
* ✅ Configuration system
* ✅ Complete documentation
* ✅ Example code snippets

NOT included:

* ❌ Job builder (shown in videos)
* ❌ Ready-made shop systems
* ❌ Complete gameplay scripts

</details>

<details>

<summary>What are the requirements?</summary>

* FiveM server (txAdmin or standalone)
* **ox\_lib** resource (required)
* Basic Lua scripting knowledge
* FiveM Keymaster access (for escrow)

</details>

***

## 🔧 Installation & Setup

<details>

<summary>Where do I put the config file?</summary>

In the InfinityUI folder

```
infinityUI/
├── fxmanifest.lua
├── config.lua  ← Here
└── client/
    └── ui.lua
```

See the [Installation Guide](https://infinityui.docs.hibry.net/installation) for details.

</details>

<details>

<summary>How do I know if InfinityUI is installed correctly?</summary>

Checklist:

1. Check server console for `Started resource infinityUI`
2. No errors in F8 console
3. Type `/infinityui_jump_to` in-game (should show a dialog)

</details>

<details>

<summary>"CONFIG FILE NOT FOUND" error — Solution</summary>

1. Make sure `config.lua` is loaded **before** `@infinityUI/client/ui.lua` in your `fxmanifest.lua`
2. Check that `InfinityUIConfig = {}` is at the top of your config file

Example:

```lua
client_scripts {
    '@infinityUI/config.lua',     -- FIRST
    '@infinityUI/client/ui.lua', -- THEN
    'client/main.lua'
}
```

</details>

***

## 💻 Development

<details>

<summary>Can I rename the InfinityUI resource?</summary>

**No.** The resource must be named `infinityUI` (case-sensitive) because other resources reference it with `@infinityUI/client/ui.lua`. If you rename it, you'll get `No such export` errors, or worse, broken functions.

</details>

<details>

<summary>How do I create my first menu?</summary>

Example:

```lua
-- Create menu
local MyMenu = InfinityUI.CreateMenu("Title", "Subtitle")

-- Add items
Citizen.CreateThread(function()
    while true do
        Wait(0)
        if InfinityUI.IsVisible(MyMenu) then
            InfinityUI.Button("Option 1", "Description", {}, true, {
                onSelected = function()
                    print("Selected!")
                end
            })
            InfinityUI.IsVisible(MyMenu)
        end
    end
end)

-- Open menu
RegisterCommand("mymenu", function()
    InfinityUI.Visible(MyMenu, true)
end)
```

See more in the [API Reference](https://infinityui.docs.hibry.net/broken-reference).

</details>

<details>

<summary>Can I use InfinityUI with ESX/QBCore?</summary>

Yes. InfinityUI works with any framework (or no framework).

Configure the integration in your config:

```lua
-- ESX
InfinityUIConfig.CoreResource = "es_extended"

-- QBCore  
InfinityUIConfig.CoreResource = "qb-core"

-- No framework
InfinityUIConfig.CoreResource = "core"
```

See [Configuration Guide](https://infinityui.docs.hibry.net/broken-reference).

</details>

<details>

<summary>How do I add a search feature to my menu?</summary>

Add this at the top of your menu:

```lua
InfinityUI.FilterButton("🔍 Search", "Filter items")
```

Then wrap your buttons:

```lua
for _, item in ipairs(items) do
    if InfinityUI.ShouldShowButton(item.name) then
        InfinityUI.Button(item.name, item.description)
    end
end
```

See [Search System](https://infinityui.docs.hibry.net/broken-reference).

</details>

***

## 🎨 Customization

<details>

<summary>Can I change the menu colors?</summary>

Yes. Edit your config:

```lua
InfinityUIConfig.Colors = {
    Primary = { 255, 0, 0, 255 },     -- Red
    Background = { 50, 50, 50, 255 },
    -- etc...
}
```

See [Configuration Guide](https://infinityui.docs.hibry.net/broken-reference).

</details>

<details>

<summary>Can I change menu sounds?</summary>

Yes.

Disable sounds:

```lua
InfinityUIConfig.EnableSounds = false
```

Or change sound profile:

```lua
InfinityUIConfig.AudioProfile = "NativeUI" -- or "InfinityUI"
```

</details>

<details>

<summary>Can players choose menu side (left/right)?</summary>

Yes. Implement `GetPlayerMenuSide()` in the config:

```lua
function InfinityUIConfig.GetPlayerMenuSide()
    local side = GetResourceKvpString("menu_side") or "left"
    return side
end

-- Let players toggle
RegisterCommand("togglemenu", function()
    local current = GetResourceKvpString("menu_side") or "left"
    local new = (current == "left") and "right" or "left"
    SetResourceKvp("menu_side", new)
end)
```

</details>

<details>

<summary>Can I translate InfinityUI to my language?</summary>

Yes. All text is in the config. Example (French):

```lua
InfinityUIConfig.JumpDialog = {
    Title = "Aller au bouton",
    Label = "Numéro du bouton (1 - %d)",
    Placeholder = ""
}

InfinityUIConfig.SearchDialog = {
    Title = "Filtrer",
    Label = "Recherche",
    Description = "Entrez un texte à rechercher",
    Placeholder = ""
}
```

</details>

***

## 🐛 Troubleshooting

<details>

<summary>My menu doesn't appear</summary>

Checklist:

* [ ] Is `InfinityUI.IsVisible(Menu)` in a Citizen.CreateThread?
* [ ] Did you call `InfinityUI.Visible(Menu, true)` to open it?
* [ ] Check F8 console for errors
* [ ] Is ox\_lib installed and started?

Debug code:

```lua
print("Menu created:", MyMenu ~= nil)
print("Menu open:", InfinityUI.Visible(MyMenu, nil))
```

</details>

<details>

<summary>Buttons don't respond to clicks</summary>

Possible causes:

1. **Enabled = false**: Check the 4th parameter

```lua
InfinityUI.Button("Test", nil, {}, true, {...}) -- true = enabled
```

2. **Missing callback**: Make sure you have an `onSelected` function
3. **Thread not running**: Verify your while loop is running

</details>

<details>

<summary>"attempt to index a nil value"</summary>

Common causes:

Cause 1: Config not loaded

```lua
-- Solution: Load config BEFORE ui.lua
client_scripts {
    'infinityui_config.lua',
    '@infinityUI/client/ui.lua'
}
```

Cause 2: Missing config field

```lua
-- Solution: Add all required fields
InfinityUIConfig.MappingSettings = {
    Command = "infinityui_jump_to",
    Description = "Menu: Jump to a button"
}
```

</details>

<details>

<summary>Performance issues / FPS drops</summary>

Solutions:

1. Reduce Wait time when menu closed:

```lua
Wait(InfinityUI.Visible(Menu, nil) and 0 or 500)
```

2. Don't recreate menus every frame:

```lua
-- ❌ BAD - Creates menu in loop
while true do
    local Menu = InfinityUI.CreateMenu(...)
end

-- ✅ GOOD - Create once
local Menu = InfinityUI.CreateMenu(...)
while true do
    -- Use menu
end
```

3. Enable auto garbage collection:

```lua
InfinityUIConfig.AutoGarbageCollect = true
```

</details>

<details>

<summary>Sounds not working</summary>

Solutions:

1. Enable sounds

```lua
InfinityUIConfig.EnableSounds = true
```

2. Check PlaySound function

```lua
function InfinityUIConfig.PlaySound(audioName, audioRef)
    if InfinityUIConfig.EnableSounds then
        PlaySoundFrontend(-1, audioName, audioRef, 1)
    end
end
```

</details>

***

## 🔐 Licensing & Purchase

<details>

<summary>Is InfinityUI open source?</summary>

**No.** InfinityUI is delivered via **FiveM Escrow (Keymaster)**. The code is encrypted.

</details>

<details>

<summary>Can I use InfinityUI on multiple servers?</summary>

Check your Keymaster license. Typically:

* ✅ Development server + Production server = OK
* ❌ Multiple production servers = Need multiple licenses

</details>

<details>

<summary>Can I modify InfinityUI?</summary>

Limited. You can:

* ✅ Configure all settings
* ✅ Extend functionality through your own scripts
* ❌ Modify the core `ui.lua` (it's encrypted)

</details>

<details>

<summary>Can I resell scripts I make with InfinityUI?</summary>

Yes — you can sell scripts that **use** InfinityUI, but:

* ✅ You can sell your own scripts
* ❌ You cannot resell InfinityUI itself
* ❌ Buyers need their own InfinityUI license

</details>

***

## 📚 Learning Resources

<details>

<summary>I'm new to Lua, where do I start?</summary>

Resources:

1. [Lua Tutorial](https://www.lua.org/pil/)
2. [FiveM Documentation](https://docs.fivem.net/docs/)
3. [CFX Forums](https://forum.cfx.re/)

Tips:

* Start with simple buttons and menus
* Copy and modify the examples
* Ask questions in Discord

</details>

<details>

<summary>Where can I find examples?</summary>

* [API Documentation - Examples Section](https://infinityui.docs.hibry.net/broken-reference)
* [Discord #examples channel](#)
* [Community showcases](#)

</details>

<details>

<summary>Are there video tutorials?</summary>

Coming soon! Check:

* Discord announcements
* YouTube channel *(if applicable)*

</details>

***

## 🆚 Comparison

<details>

<summary>InfinityUI vs RageUI?</summary>

| Feature             | RageUI | InfinityUI |
| ------------------- | ------ | ---------- |
| Search              | ❌      | ✅          |
| Quick Jump          | ❌      | ✅          |
| Menu Side Toggle    | ❌      | ✅          |
| Actively Maintained | ❌      | ✅          |
| Modern Features     | ❌      | ✅          |

</details>

<details>

<summary>InfinityUI vs CoraUI?</summary>

| Feature      | CoraUI | InfinityUI |
| ------------ | ------ | ---------- |
| Search       | ❌      | ✅          |
| Quick Jump   | ❌      | ✅          |
| Sound Toggle | ❌      | ✅          |
| Performance  | ⚠️     | ✅          |

</details>

<details>

<summary>InfinityUI vs NativeUI?</summary>

InfinityUI is **based on** NativeUI but with:

* ✅ Better performance
* ✅ More features (search, jump)
* ✅ Active development
* ✅ Better customization

</details>

***

## ❓ Still Have Questions?

* 📖 Check the [API Reference](https://infinityui.docs.hibry.net/api-reference)
* 💬 Ask in [Discord](https://discord.gg/ZxHZrGvMmy)
* 🐛 Report bugs properly (see [Support](https://infinityui.docs.hibry.net/support))

{% hint style="success" %}
**Can't find your answer?** Join our [Discord](https://discord.gg/ZxHZrGvMmy) and ask the community!
{% endhint %}
