Esx Legacy Stress

Hey guys i was looking for a good stress system for esx legacy and couldnt find anything, all the old ones dont run on legacy and the esx_basicneeds has changed with legacy so its hard to implement it. I edited “Utku_stress” to run on legacy, removed the bugs/unwanted exports, got a new client main to swap with your esx_basicneeds and included some exports to use and a example item for ox inventory to add/remove the stress, currently its only setup to shoot weapons/parachuting and going stealth, add as many as you like in client. got a install guide if needed!
edit: also added crashing cars, driving over 100mph, sprint duration and fist fighting!
Requirements: Esx Legacy “Im using 1.9.4”, Esx_basicneeds, and a hud that displays stress, im using Dx_hud
Preview: Esx Legacy Stress! - YouTube
Download Link: GitHub - Vihtal/esx-stress: stress system for esx legacy

Hope you Enjoy :smiley:

9 Likes

nice work bro

1 Like

Thank you for the share and the awsome job Vihtal, I’ll try yours as my current one gives me stress when i use the weapon_petrolcan from ox inventory.

1 Like

true this one probably will as well honestly, i never thought of that lol :open_mouth: if i come up with a fix ill let you know

1 Like

thanks man :smiley:

Even tho i added the petrolcan in the ignore weapons in ox_inventory. I still get stressed from using that…

yikes, ill do some testing tommorow and see what i can find, i just used a gas can to fill up my car with legacy fuel and didnt give me stress, not sure if your fueling up a car or using the weapon to spill gas tho

1 Like

That would be cool, in case i don’t find a solution would you share how you added the gas can ? I would appreciate it alot.

1 Like

Great job, man! I’m glad you shared it. Thank you so much!

1 Like

so it looks like the only gas can i have in my ox weapons/items is the default one
[‘WEAPON_PETROLCAN’] = {
label = ‘Gas Can’,
weight = 1000,
},
legacyfuel is using this one as well it seems

no problem hope you enjoy :smiley:

Same here. I don’t know. I’ve tried things and not working, I’ll give up and just remove the petrolcan so people can’t use that.

Maybe you can implement this in ?

Citizen.CreateThread(function()
local playerPed = PlayerPedId()
local petrolcanHash = GetHashKey(“WEAPON_PETROLCAN”)

while true do
    Citizen.Wait(5)
    
    local currentWeapon = GetSelectedPedWeapon(playerPed)
    
    -- Check if the current weapon is weapon_petrolcan
    if currentWeapon == petrolcanHash then
        DisableControlAction(1, 24, true) -- Disable attack input
        DisableControlAction(1, 25, true) -- Disable aim input
        DisablePlayerFiring(playerPed, true) -- Disable firing
    end
end

end)

local blacklistedWeapons = {
“WEAPON_RPG”, – Add more weapon hashes here if needed
“WEAPON_MINIGUN”,
– Add more weapons you want to blacklist
}

Citizen.CreateThread(function()
while true do
local ped = PlayerPedId()
local status = IsPedShooting(ped)
local silenced = IsPedCurrentWeaponSilenced(ped)
local currentWeapon = GetSelectedPedWeapon(ped)

    local isWeaponBlacklisted = false
    for _, weaponHash in ipairs(blacklistedWeapons) do
        if GetHashKey(weaponHash) == currentWeapon then
            isWeaponBlacklisted = true
            break
        end
    end

    if status and not silenced and not isWeaponBlacklisted then
        TriggerServerEvent("stress:add", 30000) -- Adjust the stress amount as needed
        Citizen.Wait(2000)
    else
        Citizen.Wait(1)
    end
end

end)

try this out, im not sure if it will for work for ya or not, also i added some new features like gain stress when driving over 100mph and crashing vehicles :smiley:

1 Like

let me know how it goes, adding more stress inducing features as we speak lol, added them to github :smiley:

can you tell me exactly where to add the exports?

1 Like

sure i can try to help out, just shoot me a message or something

Ottimo, era proprio quello che stavo cercando, grazie!!
Cosa può essere che non mi visualizza gli effetti ottici quando sono sotto stress?

1 Like

sorry had to translate so not sure if im replying correctly, are you not seeing the hud for stress or just not the shake effect while your stressed out?