adl_npcrob

This script allows players to kidnap NPCs and force them to perform various actions such as following, dancing, or staying in a specific place.

📂 Configuration - config.lua

Example of valid weapon configuration for kidnapping:

Config.GeneralSettings = {
        ["validweapons"] = {
            'WEAPON_PISTOL',
            'WEAPON_KNIFE',
            `WEAPON_COMBATPISTOL`,
        }
        }

📌 The validweapons list contains the weapons that can be used to kidnap an NPC, meaning pointing at them to force them to perform actions.

🎮 Key Configuration - DisableKeysWhenOpenMenu

The script includes its own menu, which is recommended to keep enabled. The following configuration ensures that when the menu is open, the player can still move and perform actions, except for the keys listed in keys, and also disables shooting.

Config.DisableKeysWhenOpenMenu = {
        firing = true,                    -- Disable shooting
        keys = {22, 157, 200, 199, 50}    -- List of controls to disable
        }

📌 When the menu is open:

🔫 Allowed Weapons for Taking Hostages

Within the Config.Hostage settings, there is another list of valid weapons specifically for grabbing an NPC by the neck as a hostage:

Config.Hostage = {
        ['Controls'] = {
            Kill = 74,
            Release = 47, 
        },
        allowedWeapons = {
            `WEAPON_PISTOL`,
            `WEAPON_COMBATPISTOL`,
            -- etc, add more weapons here
        }
        }

📌 The allowedWeapons list contains the weapons that allow grabbing an NPC by the neck and using them as a hostage.

🚫 NPC Blacklist - BlacklistPeds

The BlacklistPeds setting prevents certain NPCs from being kidnapped. This is useful to prevent players from taking gang members, police officers, or other specific characters as hostages.

Config.GeneralSettings = {
        ["BlacklistPeds"] = {
            'g_m_y_korean_02', 'g_m_y_korlieut_01', 'g_m_y_lost_01', 'g_m_y_lost_02', 'g_m_y_lost_03', 
            'g_m_y_mexgang_01', 'g_m_y_mexgoon_02', 'g_m_y_pologoon_01', 'g_m_y_mexgoon_03', 
            'g_m_y_pologoon_02', 'g_m_y_salvagoon_01', 'g_m_y_salvagoon_02', 'g_m_y_salvagoon_03'   
        }
        }

📌 If an NPC is on this list, they cannot be kidnapped or taken hostage. It is recommended to add security NPCs, law enforcement officers, or key event characters to prevent unwanted interactions.

📜 Display Hostage Text - DrawTextHostage

This function displays on-screen instructions on how to interact with an NPC taken as a hostage.

function DrawTextHostage(bool, typ)
        if typ == "Custom" then
            if bool then
                exports['adl_draw']:ShowText({
                    { id = "SecKey1", tecla = 'H', accion = "Execute" },
                    { id = "SecKey2", tecla = 'G', accion = "Release" },
                })
            else
                exports['adl_draw']:HideText()
            end
        elseif typ == "Native" and bool then
            ShowHelpNotification('Press ~INPUT_THROW_GRENADE~ to release or ~INPUT_VEH_HEADLIGHT~ to execute')
        end
        end

🔧 Export to Disable NPCs from Other Scripts

This export prevents NPCs created in other scripts from being affected:

exports["adl_npcrob"]:disablePedForInt(ped)

ℹ️ Additional Information

You can change the image that appears above the NPC’s head very easily by navigating to the following path:

adl_draw/stream/adl_rob.ytd

Open it in programs like Open IV and replace the texture with your image.

Este script permite a los jugadores secuestrar NPCs y obligarlos a realizar diversas acciones como seguir, bailar o permanecer en un lugar específico.

📂 Configuración - config.lua

Ejemplo de configuración de armas válidas para secuestro:

Config.GeneralSettings = {
        ["validweapons"] = {
            'WEAPON_PISTOL',
            'WEAPON_KNIFE',
            `WEAPON_COMBATPISTOL`,
        }
        }

📌 La lista validweapons contiene las armas con las que se puede secuestrar un NPC, es decir, apuntarle para obligarlo a realizar acciones.

🎮 Configuración de Teclas - DisableKeysWhenOpenMenu

El script incluye un menú propio que es recomendable mantener. La siguiente configuración permite que cuando el menú esté abierto, el jugador pueda seguir moviéndose y realizando acciones, excepto las teclas indicadas en la lista de keys, y también deshabilita el disparo.

Config.DisableKeysWhenOpenMenu = {
        firing = true,                    -- Deshabilitar disparar
        keys = {22, 157, 200, 199, 50}    -- Lista de controles a deshabilitar
        }

📌 Cuando el menú está abierto:

🔫 Armas permitidas para tomar rehenes

Dentro de la configuración de Config.Hostage, hay otra lista de armas válidas específicamente para tomar un NPC del cuello como rehén:

Config.Hostage = {
        ['Controls'] = {
            Kill = 74,
            Release = 47, 
        },
        allowedWeapons = {
            `WEAPON_PISTOL`,
            `WEAPON_COMBATPISTOL`,
            -- etc, agrega más armas aquí
        }
        }

📌 La lista allowedWeapons contiene las armas que permiten agarrar a un NPC del cuello y usarlo como rehén.

🚫 Lista negra de NPCs - BlacklistPeds

La configuración BlacklistPeds impide que ciertos NPCs puedan ser secuestrados. Esto es útil para evitar que los jugadores tomen como rehenes NPCs de bandas, policías u otros personajes específicos.

Config.GeneralSettings = {
        ["BlacklistPeds"] = {
            'g_m_y_korean_02', 'g_m_y_korlieut_01', 'g_m_y_lost_01', 'g_m_y_lost_02', 'g_m_y_lost_03', 
            'g_m_y_mexgang_01', 'g_m_y_mexgoon_02', 'g_m_y_pologoon_01', 'g_m_y_mexgoon_03', 
            'g_m_y_pologoon_02', 'g_m_y_salvagoon_01', 'g_m_y_salvagoon_02', 'g_m_y_salvagoon_03'   
        }
        }

📌 Si un NPC está en esta lista, no podrá ser secuestrado ni tomado como rehén. Se recomienda agregar NPCs de seguridad, fuerzas del orden o personajes clave de eventos para evitar interacciones no deseadas.

📜 Mostrar Texto de Rehén - DrawTextHostage

Esta función muestra instrucciones en pantalla sobre cómo interactuar con un NPC tomado como rehén.

function DrawTextHostage(bool, typ)
        if typ == "Custom" then
            if bool then
                exports['adl_draw']:ShowText({
                    { id = "SecKey1", tecla = 'H', accion = "Ejecutar" },
                    { id = "SecKey2", tecla = 'G', accion = "Soltar" },
                })
            else
                exports['adl_draw']:HideText()
            end
        elseif typ == "Native" and bool then
            ShowHelpNotification('Presiona ~INPUT_THROW_GRENADE~ para soltar o ~INPUT_VEH_HEADLIGHT~ para ejecutar')
        end
        end

🔧 Export para deshabilitar NPCs de otros scripts

Este export evita que los NPCs creados en otros scripts sean afectados:

exports["adl_npcrob"]:disablePedForInt(ped)

ℹ️ Información adicional

Puedes cambiar la imagen que aparece encima de la cabeza del NPC de una forma muy sencilla, busca la siguiente ruta:

adl_draw/stream/adl_rob.ytd

Ábrelo en programas como Open IV y reemplaza la textura por tu imagen.