Hey do you what I can use to give a specific item in consumableItems table?
i am trying to have it give raw meat when harvesting a dead animal and all is working except it doesn’t give it or show in inventory. I am not sure if this is the correct variable to use but this is what I am using
for i, animal in pairs(animals) do
if not DoesEntityExist(animal) then
table.remove(animals, i)
elseif IsPedDeadOrDying(animal, 1) then
playerX, playerY, playerZ = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
pedX, pedY, pedZ = table.unpack(GetEntityCoords(animal, true))
if(Vdist(playerX, playerY, playerZ, pedX, pedY, pedZ) < 3.0)then
DisplayHelpText("Press ~INPUT_CONTEXT~ to harvest animal.")
if IsControlJustReleased(1, 51) then -- INPUT_CELLPHONE_DOWN
if DoesEntityExist(GetPlayerPed(-1)) then
RequestAnimDict("pickup_object")
while not HasAnimDictLoaded("pickup_object") do
Citizen.Wait(1)
end
for i,Consumable in ipairs(animalItems) do
animalItems.count[i] = 1.0
end
TaskPlayAnim(PlayerPedId(), "pickup_object", "pickup_low", 8.0, -8, -1, 49, 0, 0, 0, 0)
--DecorSetFloat(PlayerPedId(), "hunger", DecorGetFloat(PlayerPedId(),"hunger")+5)
--DecorSetFloat(PlayerPedId(), "thirst", DecorGetFloat(PlayerPedId(),"thirst")+2)
animalItems.count[1] = 1.0
Citizen.Wait(2000)
ClearPedSecondaryTask(GetPlayerPed(-1))
DeleteEntity(animal)
table.remove(animals, i)
end
end
end
else
-------------------------------