hello so I wanted to ask for help, I have an issue on consumables from qb-smallresources.
I am trying to add new type of food with prop and animation but something weird happends.
I have set-up the events and everything seems to be correct but the animation doesn’t work until I restart the script.
I’m using the default of the consumables eating animation & prop for test but it still happends.
the progressbar does runs + item remove on finish so thats weird…
client consumables:
RegisterNetEvent(‘consumables:client:EatPizza’, function(itemName)
QBCore.Functions.Progressbar(‘eat_something’, Lang:t(‘consumables.eat_progress’), 5000, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true
}, {
animDict = ‘mp_player_inteat@burger’,
anim = ‘mp_player_int_eat_burger’,
flags = 49
}, {
model = ‘prop_cs_burger_01’,
bone = 60309,
coords = vec3(0.0, 0.0, -0.02),
rotation = vec3(30, 0.0, 0.0),
}, {}, function() – Done
TriggerEvent(‘qb-inventory:client:ItemBox’, QBCore.Shared.Items[itemName], ‘remove’)
TriggerServerEvent(‘consumables:server:addHunger’, QBCore.Functions.GetPlayerData().metadata.hunger + Config.Consumables.eatpizza[itemName])
TriggerServerEvent(‘hud:server:RelieveStress’, math.random(2, 4))
end)
end)
server side:
for k, _ in pairs(Config.Consumables.eatpizza) do
QBCore.Functions.CreateUseableItem(k, function(source, item)
local Player = QBCore.Functions.GetPlayer(source)
if not exports[‘qb-inventory’]:RemoveItem(source, item.name, 1, item.slot, ‘qb-smallresources:consumables:EatPizza’) then return end
TriggerClientEvent(‘consumables:client:EatPizza’, source, item.name)
end)
end
config:
eatpizza = {
-- Pizza This
['tiramisu'] = math.random(40, 50),
['gelato'] = math.random(20, 30),
['medfruits'] = math.random(50, 60),
['bolognese'] = math.random(10, 15),
['calamari'] = math.random(15, 20),
['meatball'] = math.random(5, 10),
['alla'] = math.random(10, 15),
['pescatore'] = math.random(10, 15),
['capricciosa'] = math.random(10, 15),
['diavola'] = math.random(10, 15),
['marinara'] = math.random(10, 15),
['margherita'] = math.random(10, 15),
['prosciuttio'] = math.random(10, 15),
['vegetariana'] = math.random(10, 15)
},
thanks for help, btw I did made it work before but I removed the code by mistake and tried to rewrite so now the issue is there…