[Release] [ESX]MrNewbStress

Re-uping my old stress triggers, its easy check a native and trigger and event.Removed it originally due to my distaste for the community but ehh its floating in the wild and id rather share than see someone selling it. ESX is required as well as a modification to your basic needs such as this [RELEASE] Stress System with basicneeds

7 Likes

:heart::v: used this script for a while! Absolutely love it and recommend it to anyone that runs a server

2 Likes

Really good piece of script. I loved it. hoping for more from you man! Very compact and does not slow you server down!!! :slightly_smiling_face: :+1: :+1:

2 Likes

I feel like most of this code could’ve been done in a single thread, no? Opening this many threads seems pretty unoptimised.

Overall though, a good idea for people who use stress.

Essentially, swimming reduces stress, driving over 120mph increases it, being in melee combat increases it, being on any bicycle (or motorbike, the native includes motorbikes) decreases it, shooting increases it (depending on the weapon type.)

Great idea, love to see some improvements to the code though.

Didn’t test this but this should merge 3 of the threads into 1. You could of course remove the elseifs and do separate if statements but I think this way is better personally.

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(100)
        local ped = GetPlayerPed(-1)
		local veh = GetVehiclePedIsIn(ped)
		local speed = GetEntitySpeed(GetVehiclePedIsIn(ped,true)) * 2.6
		if IsPedInAnyVehicle(ped,false)	and speed >= 120 then
		  TriggerEvent('esx_status:add','stress',300)
		  print(speed)
		  Citizen.Wait(3000)
		elseif IsPedInMeleeCombat(ped) then
			TriggerEvent('esx_status:add','stress',300)
			Citizen.Wait(3000)
		elseif IsPedSwimming(ped) then
			TriggerEvent('esx_status:remove','stress',200)
		end
	end
end)
4 Likes

This is similar to how I use it atm, I wanted to make it more of a template for people. Currently it runs very well as it is from every test I’ve done, the speed check has to have the delay it had because of some fivem anticheat stuff and it’s overall just better his way. Solid feedback and I greatly appreciate it :). My main reason for releasing is I know someone is selling a similar system and from what I’ve heard it’s overly complex for newcomers to adapt to needs. Plus spike thought me how to use arrays and I think having that fully customizable is just the coolest. So many natives could be used in something like this and it’s a blast.

1 Like

Everything works but I get this error in console…

have you modified esx_basic needs to support the stress? also the weapon you are using is it listed in the table at the top or the stressarray file? Try and delete the values in the table and see is that makes a different on the user.

Ey! i tried to download the file but the link is broken. Is there another way to download it?

Thanks! It will really help me!

1 Like

Unlisted until download is fixed

fixed