Help with stress relief when smoking joints - QB Core

I have tried multiple different triggers to relieve player stress when a player smokes a joint. Stress is being relieved however the problem is that it keeps reducing stress multiple times. Once you light a joint and start smoking, it reduces a chunk of stress with the message: “you are relaxing” but then a few seconds later the message pops up again and more stress is relieved. This happens about five times, usually reducing stress to 0.

I’d prefer to be able to set each joint to only reduce x amount of stress once when smoked so that multiple joints are needed to reduce stress completely.

Here is the current net event for smoking joints that I have:

RegisterNetEvent(‘consumables:client:UseJoint’, function()

QBCore.Functions.Progressbar("smoke_joint", "Lighting joint..", 1500, false, true, {

    disableMovement = false,

    disableCarMovement = false,

    disableMouse = false,

    disableCombat = true,

}, {}, {}, {}, function() -- Done

    TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items["joint"], "remove")

    if IsPedInAnyVehicle(PlayerPedId(), false) then

        TriggerEvent('animations:client:EmoteCommandStart', {"smoke3"})

    else

        TriggerEvent('animations:client:EmoteCommandStart', {"smokeweed"})

    end

    TriggerEvent("evidence:client:SetStatus", "weedsmell", 300)

    TriggerEvent('animations:client:SmokeWeed')

    TriggerServerEvent('hud:server:RelieveStress', 10)

    Wait(3000)

    ClearPedTasks(ped)

end)

end)

Any help is greatly appreciated

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.