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