[RELEASE] Stress System with basicneeds

Look here at the forums - There are plenty of animation scripts you can choose to use, with an animation such as smoking.

Then, you could just make a check if it’s the smoking emote, if it is, then this code gets triggered:

TriggerClientEvent (‘esx_status: remove’, source, ‘stress’, 100000)

Hello! I am trying that when I reach 100% I make the depressed animation, but when you reach 0% the depressed animation is removed, I currently have the code to myself, the case is that when you reach 100% if you make the depressed animation , but when I have it at 0, keep doing the animation and there is no way to remove it, the only way is F3 and normal walking

It works… i run it on my server… do you have drunk in esx_basicneeds?
Mby it’s not working for you because u don’t have a drunk stuff

can u share whole file ?? it would be awsome :heart_eyes:

You can try this code;

elseif stressVal <= 100000 then

ClearPedTask or StopAnimTask(…anim detail…) etc.

but it may not be useful as stress walking is easily inactivated.

1 Like

Could you replace the stamina bar with a streess bar?

You mean yes?

possibly, if I finish it as I would like

Not “>=” you can try “<=”.

It’s only guess. Maybe work maybe not :slight_smile:

1 Like

That doesnt work I just tried

So i have a problem i have the stress working but i can’t remove the stress i have tried adding this TriggerClientEvent (‘esx_status: remove’, source, ‘stress’, 100000) to my drug effect but when doing this it fails my drug script here is my effect i am doing.

onDrugs = true
TaskStartScenarioInPlace(playerPed, “WORLD_HUMAN_SMOKING_POT”, 0, 1)
TriggerClientEvent(‘esx_status: remove’, source, ‘stress’, 100000)
Citizen.Wait(3000)
ClearPedTasksImmediately(playerPed)
SetTimecycleModifier(“spectator5”)
SetPedMotionBlur(playerPed, true)
SetPedMovementClipset(playerPed, “move_m@hurry_butch@a”, true)
local player = PlayerId()
AddArmourToPed(playerPed, 100)
local health = GetEntityHealth(playerPed)
local newHealth = math.min(maxHealth , math.floor(health + maxHealth/6))
SetEntityHealth(playerPed, newHealth)
onDrugs = false

Try this;

TriggerEvent(‘esx_status: remove’, ‘stress’, 100000)

That did not work also :slight_smile:

1 Like

I think you put the code in the wrong place.

Because, this code is working.

For clientside: TriggerEvent(‘esx_status:remove’, ‘stress’, 100000)
For serverside: TriggerClientEvent (‘esx_status:remove’, source, ‘stress’, 100000)

Anyone have a way of adding stress when you kill someone i couldn’t figure it out and i tried to do it through deathevents but that triggers it for the player that you kill

TriggerEvent(‘esx_status:add’, ‘stress’, -100000)
try this bro :wink:

Nahhh did not work and for some reason i can’t get it to work whenever i add the code to jk drug’s on smoking pot to remove stress it brakes the resource.

Like what i want it to do is when using hard drug’s like cocaine ect it add’s stress and when smoke pot if removes stress with jk drug’s. :slight_smile:

Try this bro;

For add:
For clientside: TriggerEvent(‘esx_status:add’, ‘stress’, 100000)
For serverside: TriggerClientEvent (‘esx_status:add’, source, ‘stress’, 100000)

For remove:
For clientside: TriggerEvent(‘esx_status:remove’, ‘stress’, 100000)
For serverside: TriggerClientEvent (‘esx_status:remove’, source, ‘stress’, 100000)

Right so i have tried all sorts of stuff and no matter what i do i can’t get stress to remove it go’s up on its own quick then i am stuck with the shaking screen and all that and if i add any of them codes to jk_drug’s server or client use joint it just brakes the resource and if i add a use joint function to with any of them codes on esx_optionalneeds server or client i use the joint and it don’t take stress away but i get the drug effects from jk_drugs and can’t see why this is not working other than having stress all the time like the only way i have been able to remove stress is after dying and being admin revived so not sure what going on.