🤠
KOJA DOCS
  • Home
  • Store
  • Discord
  • lib
    • Client
  • NEW
    • 🚗Cardealer
      • Installation
      • Configuration
        • Creating a Cardealer
        • Changing Language
        • Creating a webhook for logging
    • 🎁Daily Rewards
      • Installation
      • Configuration
        • 🇵🇱Changing Language
        • 🛡️Debug Prints
        • 🚪Open Commands
        • 🛒Shop Link
        • ✏️Theme
        • 🖥️Auto Table
        • 🎁Rewards
        • 🎟️Missions
        • 📔Promocodes
      • Guides
        • ✈️Creating/Editing Locales
        • 🔫Managing Missions
        • 💎Setting Premium Status
    • 📊Hud
      • Installation
      • Configuration
        • 🇵🇱Changing Language
        • 🛡️Debug Prints
        • 🚪Settings Command
        • 🗺️Hide Minimap
        • 🗒️Notifications
        • 🏎️Nitro
        • ⚙️Engine
        • 💺Seatbelt
        • 🤖Cruisemode
      • Guides
        • ✈️Creating/Editing Locales
        • 🔗Progressbar
        • ℹ️TextUI
    • 🔫Shop Heist
      • Installation
      • Configuration
        • 🇵🇱Changing Language
        • 👮Required Police To Start Heist
  • 🛒Shops
    • Installation
    • Configuration
      • 🇵🇱Changing Language
      • 🎯Target
      • 🛍️Adding new shop
      • 🚗Server side exports
      • 📃SQL
    • Guides
      • ✈️Creating/Editing Locales
  • 📜Dialogs
    • Installation
    • Configuration
      • 🇵🇱Changing Language
      • 🎯Target
      • 📃Create Dialog
      • 🎹Available Keys
      • 🌀Default Images
  • OLD
    • 🎓Jobselector [FREE]
      • 📕Step By Step Guide
      • ⚙️Server
    • 🛠️Crafting [FREE]
      • 📕Step By Step Guide
      • 👇Client
      • 👆Server
Powered by GitBook
On this page
  1. Shops
  2. Configuration

Target

Target Configuration

The Config.Target section in the configuration file determines whether your server will use an external target system for NPC interactions (like ox_target), or fall back to the default method of displaying text over NPCs. Here's a breakdown of how this works:

1. Target Enabled (Config.Target.enabled = true)

When the enabled property is set to true, the server will rely on the external target system (in this case, ox_target). This means that NPC interactions will be handled by ox_target, and the user will need to use the target system's functionality to interact with NPCs.

  • Target Resource: The resource field indicates which resource to use for the target system. In this example, it's set to "ox_target", meaning it will use the ox_target resource to handle NPC interaction.

shared/config.lua
Config.Target = {
    enabled = false,
    resource = "ox_target",
}
  • Behavior:

    • The NPC will have a dynamic interaction, and you will use the target system to interact with the NPC (e.g., a circle or indicator will appear around the NPC, and the player will click on the target to initiate interaction).

    • This method provides a more polished and integrated experience for NPC interactions.

2. Target Disabled (Config.Target.enabled = false)

When the enabled property is set to false, the server does not use any external target system, and the default interaction method is used. In this case, the NPC will show a text label above its head (such as "[E] - Supermarket 24/7"), and players can press the configured key (e.g., [E]) to interact with the NPC.

  • DrawText: With enabled = false, the NPC interaction is based on a simple text prompt that appears above the NPC, usually controlled via DrawText or similar functions. This text will display the interaction key (e.g., [E] - Supermarket 24/7), instructing the player to press the corresponding button to interact.

    Example:

shared/config.lua
npc = {
    name = "Mark",
    hash = 0x18CE57D0,  -- Hash of the NPC model
    scenario = "WORLD_HUMAN_CLIPBOARD",  -- Scenario/animation for the NPC
    target = {
        icon = "fas fa-shopping-basket",  -- The icon to show with the target interaction (for ox_target)
        label = "[E] - Supermarket 24/7",  -- The label that will be shown over the NPC
        distance = 2.0,  -- Distance within which the interaction is possible
        key = 38,  -- The key used for interaction (38 corresponds to the [E] key)
    }
}

Behavior:

  • When the target system is disabled, players will see a text label above the NPC, such as [E] - Supermarket 24/7. They can then press the key (e.g., E with key code 38) to interact with the NPC.

  • This method is simpler and does not require an external resource but still provides basic interaction functionality.

Summary of Behavior Based on Config.Target.enabled

Enabled

Method

Resource

Interaction

Key Binding

true

Uses target system (e.g., ox_target)

ox_target

Dynamic NPC interaction (circle, icons)

Configured via ox_target

false

Draws text above the NPC's head

No external resource

Simple interaction with text (e.g., [E] - Supermarket 24/7)

Customizable via key

PreviousChanging LanguageNextAdding new shop

Last updated 1 month ago

🛒
🎯