CLX-HEALTHSYSTEM

Guide to Using Exports in clx-healthsystem

This guide explains how to use the exports added to the clx-healthsystem script. These exports allow you to retrieve the health percentage of individual bones in the system. Below, you'll find details on their functionality and usage.


Overview

The script provides exports to get the health percentages for specific body parts (bones). Each export follows this naming convention:

Get<BoneName>HP()

For example:

  • GetHeadHP()

  • GetLeftArmHP()

  • GetRightLegHP()

Each function returns the health percentage (a number between 0 and 100) of the corresponding bone.


Implementation Details

Location

These exports are implemented client-side. This means they must be called from client-side scripts.


How to Use

Example Usage

Here is a sample client-side script demonstrating how to use these exports:

local headHP = exports["clx-healthsystem"]:GetHeadHP()
print("Head health: " .. headHP .. "%")

local leftArmHP = exports["clx-healthsystem"]:GetLeftArmHP()
print("Left Arm health: " .. leftArmHP .. "%")

local rightLegHP = exports["clx-healthsystem"]:GetRightLegHP()
print("Right Leg health: " .. rightLegHP .. "%")

Integration Steps

  1. Ensure that the clx-healthsystem script is properly installed and started on your server.

  2. In your client-side script, use the exports to retrieve the health values as needed.


Export List

Here’s a list of all the available exports in the clx-healthsystem script:

  • GetHeadHP()

  • GetThoraxHP()

  • GetStomachHP()

  • GetLeftArmHP()

  • GetRightArmHP()

  • GetLeftLegHP()

  • GetRightLegHP()


Notes

  • These exports are read-only; they do not allow you to modify the health values of the bones.

  • Ensure you call the exports from the client-side context to avoid errors.


Troubleshooting

  • Issue: The export returns 0 unexpectedly.

    • Solution: Verify that the health system is correctly tracking the bone's health in-game.

  • Issue: The export is not recognized.

    • Solution: Confirm that the clx-healthsystem resource is started and that you are calling the export from a client-side script.


If you have any further questions or need assistance, feel free to reach out!

Last updated