> For the complete documentation index, see [llms.txt](https://docs.gunchi.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gunchi.dev/scripts/crypto-mining/installation.md).

# Installation

## **1. Add Interaction Type to Core Game**

Add the following entry to:

**`core_game > config.lua > Config.InteractionTypes`**

This defines the interaction logic for server racks.

```lua
['cryptominer'] = {
    PromptName = 'Server Rack',
    PromptDescription = 'I\'m way outta my depth...',
    PromptIcon = 'fa-solid fa-server',
    PromptComplete = function(objConf, obj)
        TaskTurnPedToFaceEntity(playerPedId, obj, 2000, 0.0, 0.0, 0.0) -- Dont set duration to infinite
        Citizen.Wait(250)
        TriggerEvent('client:cryptomining:getminer', source)
    end,
    Object = `v_corp_servercln`,
    UseItemMetadata = true,
    InteractDist = 1.3,
    ReturnItem = 'serverrack',
    StoreMetadataOnReturn = true,
    Offset = vector4(0.0, 0.0, -1.0, 0.0),
    LimitUse = false,
},
```

***

## **2. Add Required Items to Core**

Add these items to:

**`core > shared.gta5.lua`**\
These define the server rack and GPU components.

```lua
["serverrack"] = {
    ["label"] = "Server Rack",
    ["weight"] = 30000,
    ["type"] = "item",
    ["image"] = "serverrack.webp",
    ["unique"] = true,
    ["stackable"] = true,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["description"] = "I could build something cool with this..",
    ["metadata"] = {
        balance = 0,
        password = 0,
        stashId = 0
    }
},

["lowendgpu"] = {
    ["label"] = "Low-End GPU",
    ["weight"] = 500,
    ["type"] = "item",
    ["image"] = "lowendgpu.webp",
    ["unique"] = false,
    ["stackable"] = true,
    ["useable"] = false,
    ["shouldClose"] = false,
    ["description"] = "Budget performance..",
    ["decay"] = 1,
    ["decayRate"] = 101
},

["midrangegpu"] = {
    ["label"] = "Mid-Range GPU",
    ["weight"] = 500,
    ["type"] = "item",
    ["image"] = "highendgpu.webp",
    ["unique"] = false,
    ["stackable"] = true,
    ["useable"] = false,
    ["shouldClose"] = false,
    ["description"] = "Affordable performance..",
    ["decay"] = 1,
    ["decayRate"] = 101
},

["highendgpu"] = {
    ["label"] = "High-End GPU",
    ["weight"] = 500,
    ["type"] = "item",
    ["image"] = "highendgpu.webp",
    ["unique"] = false,
    ["stackable"] = true,
    ["useable"] = false,
    ["shouldClose"] = false,
    ["description"] = "Not so affordable performance..",
    ["decay"] = 1,
    ["decayRate"] = 101
},
```

***

## **3. Add Radial Menu Entry**

Add the following submenu under:

**`radialmenu > config.lua > newSubMenus`**\
This allows players to pick up server racks through the radial menu.

```lua
['general:pickupServerRack'] = {
    title = 'Pickup Server',
    icon = 'server',
    iconCategory = 'solid',
    functionName = 'cryptomining:client:pickupClosestMiner',
    enableMenu = function()
        return not isDead and (exports['core_game']:CanPickupInteractionObject('cryptominer'))
    end,
},
```

Then **add `'general:pickupServerRack'`** to the **general rootMenuConfig** list so it appears in the main radial menu.

***

## **4. Add Item Images**

Place the following images into your inventory image folder:

* `serverrack.webp`
* `lowendgpu.webp`
* `highendgpu.webp`

Make sure the filenames match the image names defined in the core item config.

***

## **5. Start the Resource**

Add to your `server.cfg` or `resources.cfg`:

```
ensure cryptomining
```

***

## **6. Testing the System**

1. Spawn or obtain a **serverrack** item.
2. Place it in the world using your core interaction system.
3. Interact with it to install GPU components.
4. Use the radial menu to **pickup** and move the rack.

If everything is correct, the cryptominer interaction will work and metadata will store balance, password, and stash ID.


---

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

```
GET https://docs.gunchi.dev/scripts/crypto-mining/installation.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.
