TWH-Scripts
  • 👋Welcome!
  • About us
    • 🚀Vision, Mission & Focus
      • Vision
      • Mission
      • Focus
    • 💖Values
  • Team
    • 👋Meet the Team!
  • Collaborating
    • 🤝How we Work Together
  • Resources
    • 📄Script-Documentations
      • Addiction
      • Bankrob
      • BodyStatusText
      • Calendar-Rewards
      • Collect
      • Lumber & Mining Essentials
      • Collector's Conquest Bundle
        • Tradingcards
        • Boosterpacks
        • Tradingcard Upgrades
      • Custom Dates
      • Dispatch-System
      • Lawmen
      • Mapmarker
      • NPC-Guides
      • Oilcorp.
      • Processing
      • Promotion-Pass
      • Social-Level System
      • Social-Pass
      • Storage
    • 📂Open Source
    • 📝Useful Snippets and Info
      • Addiction and Metabolism
  • Services
    • 🛠️Custom Orders and Personalized Development Services
    • 📖Advanced Logging System
Powered by GitBook
On this page
  • Instruction manual
  • Installation
  • Usage
  1. Resources
  2. Script-Documentations

Addiction

Frameworks: VORP

Introducing the twh_addiction script, an advanced and customizable Drug Addiction System designed for use with the VORP framework. This script offers a comprehensive solution to simulate drug addiction and its effects within your game world. Unlock a wide array of features that can be tailored to your specific requirements.

Key Features:

  1. Full API Integration: Seamlessly integrate the twh_addiction script with other scripts to create a cohesive experience.

  2. Admin Commands: Easily manage the script using the built-in admin commands.

  3. Customizable Addiction-Types: Create your own addiction-types to cater to various in-game scenarios.

  4. Custom Drug Items and Animations: Customize drug items and their associated animations for an immersive experience.

  5. Separated Addictions and Drugs: Maintain flexibility and freedom by separating addictions and drugs from one another.

  6. Time-Modifier Configuration: Adjust time-modifiers for each addiction type, allowing for potential reduced work times in future twh scripts.

  7. Effect Duration and Usage Settings: Configure the duration of effects and the number of usages needed before an effect triggers for each addiction.

  8. Addiction Reset Upon Death: Addictions will automatically reset after a player's character dies, offering a fresh start.

With the twh_addiction script, you can provide your players with a realistic and engaging drug addiction experience. Create the perfect environment with custom items, addictions, and effects to suit your unique game world.

Initialization

local AddictAPI = exports['twh_addiction'].AddictionAPI()

Usage

local addictCounter = AddictAPI.getCounter(addiction)
local allAddictCounter = AddictAPI.getAllCounter()
local onAddiction = AddictAPI.getOnAddiction(addiction)
local isOnDrug = AddictAPI.getIsOnDrug() -- returns the current drug
AddictAPI.setAddiction(addiction)                        -- set counter to config amount needed
AddictAPI.removeAddiction(addiction)                     -- set counter to 0
AddictAPI.removeIsOnDrug(addiction)                      -- remove drug effect
AddictAPI.setIsOnDrug(addiction)                         -- trigger drug effect
AddictAPI.increaseAddictionCounter(addiction,amount)     -- increase consumed counter with specific amount
AddictAPI.itemUsed(addiction,amount)                     -- if you config other items you can use this to define what addiction should be increased

Admin Commands

  • setAddiction [id][addiction]

  • removeAddiciton [id][addiction]

  • removeOnDrug [id][addiction]

  • setOnDrug [id][addiction]

Instruction manual

Installation

First execute the sql file which is in the zip folder (Will be changed in the future)

Add following line to your server.cfg or ressource.cfg:

  • ensure twh_addiction

Usage

The twh_addiction script is designed primarily as a powerful resource for developers. To fully harness the potential of the twh_addiction script, simply refer to the API documentation provided above. The API enables you to access various functionalities, customize addiction types, drug items, animations, and effects, and configure time-modifiers, effect durations, and other parameters as needed. By leveraging the twh_addiction API, you can create unique and engaging gameplay scenarios that cater to your specific requirements and the needs of your players.

PreviousScript-DocumentationsNextBankrob

Last updated 2 years ago

📄
TWH-Scripts | twh_addiction
Logo