Exports

Server Exports 🖥️

➤ AddStress

📌 Adds stress to a specific player.

exports["nrg_stress"]:AddStress(source, value)
  • source (number) – Player server ID.

  • value (number) – Amount of stress to add.

✅ Example:

exports["nrg_stress"]:AddStress(1, 15)

➡️ Adds 15 stress points to player ID 1.


➤ SetStress

📌 Sets a specific stress value for a player.

exports["nrg_stress"]:SetStress(source, value)
  • source (number) – Player server ID.

  • value (number) – Exact stress level to assign.

✅ Example:

exports["nrg_stress"]:SetStress(1, 50)

➡️ Sets the stress level of player ID 1 to 50.


➤ SetStressProof

📌 Grants or removes immunity to specific stress sources.

exports["nrg_stress"]:SetStressProof(source, name, value)
  • source (number) – Player server ID.

  • name (string) – Stress type: Shooting, CarCrash, Fight, FastDriving, SeenPedKilled.

  • value (number) – 1 for immune, 0 to disable immunity.

✅ Example:

exports["nrg_stress"]:SetStressProof(1, "Shooting", 1)

➡️ Grants player ID 1 immunity to stress caused by shooting.


➤ SetTemporaryProof

📌 Temporarily reduces incoming stress for a player.

exports["nrg_stress"]:SetTemporaryProof(source, percent, time)
  • source (number) – Player server ID.

  • percent (number) – Percentage reduction (e.g., 50).

  • time (number) – Duration in seconds.

✅ Example:

exports["nrg_stress"]:SetTemporaryProof(1, 50, 10)

➡️ Reduces stress gain by 50% for 10 seconds for player ID 1.


Client Exports 👨🏻‍💼

➤ AddStress

📌 Adds stress to the local player.

exports["nrg_stress"]:AddStress(value)
  • value (number) – Amount of stress to add.

✅ Example:

exports["nrg_stress"]:AddStress(10)

➡️ Adds 10 stress points to the local player.


➤ GetStress

📌 Retrieves the current stress level of the local player.

local stress = exports["nrg_stress"]:GetStress()

Returns: number – Current stress level.

✅ Example:

print("Current stress:", exports["nrg_stress"]:GetStress())

➡️ Prints the local player’s stress level to the console.


➤ SetStress

📌 Sets the local player’s stress level.

exports["nrg_stress"]:SetStress(value)
  • value (number) – Stress level to assign.

✅ Example:

exports["nrg_stress"]:SetStress(20)

➡️ Sets the local player's stress level to 20.


➤ SetStressProof

📌 Grants or removes immunity to a specific stress source for the local player.

exports["nrg_stress"]:SetStressProof(name, value)
  • name (string) – Shooting, CarCrash, Fight, FastDriving, SeenPedKilled.

  • value (number) – 1 for immune, 0 to disable.

✅ Example:

exports["nrg_stress"]:SetStressProof("FastDriving", 1)

➡️ Grants immunity to stress from fast driving.


➤ SetTemporaryProof

📌 Applies temporary stress reduction to the local player.

exports["nrg_stress"]:SetTemporaryProof(percent, time)
  • percent (number) – Percentage reduction.

  • time (number) – Duration in seconds.

✅ Example:

exports["nrg_stress"]:SetTemporaryProof(30, 5)

➡️ Reduces stress gain by 30% for 5 seconds.


➤ GetStressProof

📌 Returns the current immunity settings for the local player.

local proofTable = exports["nrg_stress"]:GetStressProof()

Returns: table – Immunity flags for each stress type.

✅ Example:

local proof = exports["nrg_stress"]:GetStressProof()
print(json.encode(proof))

➡️ Displays the player's current immunity configuration.

Last updated