Hello, I have a script that should give an item after an animation and progressbar
the progressbar and animation does show but it dont give item
Server side :
RegisterServerEvent('esx_fastfood:cookedDrink')
AddEventHandler('esx_fastfood:cookedDrink', function()
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
if xPlayer.canCarryItem('drink', 1) then
xPlayer.addInventoryItem('drink', 1)
else
xPlayer.showNotification('~r~Inventory!', true, false, 120)
end
end)
Client side :
if IsControlJustReleased(0, E_KEY) then
TaskStartScenarioInPlace(PlayerPedId(), 'PROP_HUMAN_BBQ', 0, false)
TriggerEvent("mythic_progbar:client:progress", {
name = "harvest_drink",
duration = 2000,
label = "loading...",
useWhileDead = false,
canCancel = true,
controlDisables = {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true,
}
}, function(status)
if not status then
xPlayer.showNotification('~g~WORKED', true, false, 120)
ClearPedTasks(PlayerPedId())
TriggerServerEvent('esx_fastfood:cookedDrink')
end
end)
end