```
QBCore.Functions.CreateUseableItem(“cigars”, function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.RemoveItem(item.name, 1, item.slot) then
TriggerClientEvent(“consumables:client:UseArmor”, src)
TriggerClientEvent(“consumables:client:Usecigars”, src)
end
end)
```
Ugh that’s using ```
No no, you are not understanding.
Please just share your “consumables:client:UseArmor” event.
Not the trigger or anything. The client event. Like you shared “consumables:client:Usecigars”
I am trying to help you.
QBCore.Functions.CreateUseableItem("cigars", function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.RemoveItem(item.name, 1, item.slot) then
TriggerClientEvent("consumables:client:UseCigars", src)
end
end)
Client File:
RegisterNetEvent("consumables:client:UseCigars", function()
QBCore.Functions.Progressbar("smoke_cigars", "Lighting cigars…", 1500, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true,
}, {}, {}, {}, function()
local ped = PlayerPedId()
TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items["cigars"], "remove")
if IsPedInAnyVehicle(ped, false) then
TriggerEvent("animations:client:EmoteCommandStart", {"smoke3"})
else
TriggerEvent("animations:client:EmoteCommandStart", {"smokeweed"})
end
if GetPedArmour(ped) < 75 then
TriggerServerEvent('hospital:server:SetArmor', 75)
SetPedArmour(ped, 75)
end
TriggerEvent("evidence:client:SetStatus", "weedsmell", 300)
TriggerEvent("animations:client:SmokeWeed")
end)
end)
Here you have the code from the joint event, inside a new cigars event. Then I took some code from the armor event and put it inside as well. So only 1 progress bar, but it does both smoke animation and armor. That is how to code. Not settle for triggering 2 events that you don’t need. Make your own. So there you go. Please mark this as the solution. Enjoy!
Don’t worry, you had it right the first time. DrAceMisanthrope was replying to me, telling me how to escape the characters to show you an example. Don’t use the backslashes, only three backticks.
I did. Thank you very much. So just replace my existing code with this yea? Thank you. It actually did work, I just forgot to change my server side code & remove the “UseArmor” section.