Exports

📦 Exports

The K9 Script System provides several exports that allow you to interact with your K9's attributes programmatically. These exports can be utilized to manage your K9's attributes and enhance gameplay functionality.

Click to view Exports List

Example Usage:

You can utilize the HandleDogAttribute export as follows:

  1. Increase Attribute

    local randomIncrease = math.random(1, 5) -- Generate a random increase value between 1 and 5
    exports['evo-k9-v2']:HandleDogAttribute('increase', 'smell', randomIncrease)
  2. Decrease Attribute

    local randomDecrease = math.random(1, 5) -- Generate a random decrease value between 1 and 5
    exports['evo-k9-v2']:HandleDogAttribute('decrease', 'stamina', randomDecrease)
  3. Get Attribute

    local currentStamina = exports['evo-k9-v2']:HandleDogAttribute('get', 'stamina')
    print("Current Stamina:", currentStamina) -- This will output the current stamina of the K9
Click to view Explanation of Attributes
  • Increase:

    • This action allows you to add a specified amount to the K9's attribute. For example, if you want to increase the dog's smell attribute by a random value between 1 and 5, you would use the 'increase' action.

  • Decrease:

    • This action lets you subtract a specified amount from the K9's attribute. For instance, if you want to reduce the dog's stamina by a random value between 1 and 5, you would call the function with 'decrease'.

  • Get:

    • This action retrieves the current value of a specific attribute. If you need to know how much stamina the K9 currently has, you would use the 'get' action.

Last updated