Modules

Modules in Ks_CTU

The modules system in Ks_Click_To_Use was implemented to improve the organization and fluidity of the script, ensuring that each Killstore product integrates seamlessly.

Whenever a new product is acquired, its respective module is automatically updated, allowing immediate use.

Additionally, you can use the Click-to-Use system for your own props by adding custom modules in:

Ks_Click_To_Use-Assets\modules\_OwnModule\my_module.lua

Module Structure

Each module is stored in:

Ks_Click_To_Use-Assets\modules\**\*.lua

For example, the Milk Bag module is located at:

Ks_Click_To_Use-Assets\modules\Milk_Bag\Milk_Bag.lua

This module specifically handles Milk Bag backpacks, and any updates to this product will automatically reflect in the module.

Example Configuration

A fully structured module looks like this:

Ks_Ctu = Ks_Ctu or {}
ProgressBar = ProgressBar or {}

Ks_Ctu.MyCustom = {

    --:: Example for an item with default customization >>
    ['Item_Name'] = {
        prop = 'prop_name',
        bodyPart = 'back', -- Uses Killstore's preconfigured position
        Progress = 'blue', -- Uses a predefined progress bar theme
    },
    
    --:: Example for a fully customized item >>
    ['Item_Name2'] = {
        prop = 'hei_prop_heist_box',
        bodyPart = {  -- Customizable position (Offset and Rotation)
        -- bone | x |  y |  z | xr |  yr | zr | flag | flag | flag | flag | flag | flag |
          24818, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true
        },
        animation = { -- Custom animation settings
            animName = 'anim@heists@box_carry@', animDict = 'idle'
        },
        sound = { 'Bomb_Disarmed', 'GTAO_Speed_Convoy_Soundset' }, -- Native GTA V sound
        surprises = {
            ['bandage'] = 1,
            ['water'] = math.random(4,6)
        },
        Progress = 'magical', -- Uses a custom Killstore progress bar for this item
    },

}

-- Default progress bar for the entire module (if not explicitly set per item)
ProgressBar.MyCustom = 'default'

Key Elements of a Module

1️⃣ Item Configuration (Ks_Ctu.MyCustom)

Each item inside the module has the following customizable settings:

Property
Description

prop

The in-game object/prop associated with the item.

bodyPart

The position where the item will be attached.

Progress

The progress bar type assigned to the item.

animation

Custom animations for using the item.

sound

GTA V native sounds triggered when using the item.

surprises

Defines item rewards when interacting with the item.

Last updated