[RELEASE] Stress System with basicneeds

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.

ESX.RegisterUsableItem(‘joint’, function(source)

local xPlayer = ESX.GetPlayerFromId(source)
local lighter = xPlayer.getInventoryItem('lighter').count
    if lighter >= 1 then
xPlayer.removeInventoryItem('joint', 1)
TriggerClientEvent('esx_optionalneeds:onjoint', source)
TriggerClientEvent('esx_status:remove', stress, 'source', 100000)
TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'success', text =  'You smoked a cigarette.' })

else

TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'error', text =  'You need a lighter.' })
end

end)

That don’t even remove stress but get drug effects from using the joint.

Solved it :slight_smile:

Do tell friend

TriggerClientEvent(‘esx_status:remove’, source, ‘stress’, 100000) that is working server side file so in server.lua
TriggerClientEvent(‘esx_status:add’, source, ‘stress’, 100000)

2 Likes

Hello! Did you put in client side or server side to add stress for something? For example… when player start’s to rob a shop u can gain stress if u add it in script manualy

1 Like

I managed to figure it out, but thanks for your response!!

ever get it to work?

Nope.

Does anyone know how to add stress when shooting or just have stress repeatedly added over tim
e

did you make it work? If so, would you share it please?

Can you share how you put that i nthe screen ? i will love it :smiley:

Some one did stress zones whit this ? :smiley:

How would I add speeding?