You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RegisterNetEvent('nfire_hunting:SellCarcass')
AddEventHandler('nfire_hunting:SellCarcass',function (item)
local itemData = exports.ox_inventory:Search(source,'slots', item)[1]
if itemData.count >= 1 then
local reward = Config.sellPrice[item].max * Config.gradeMultiplier[itemData.metadata.type]
if Config.degrade and itemData.metadata.durability ~= nil then
local currentTime = os.time()
local maxTime = itemData.metadata.durability
local minTime = maxTime - itemData.metadata.degrade * 60
if currentTime >= maxTime then
currentTime = maxTime
end
reward =math.floor(map(currentTime, maxTime, minTime, Config.sellPrice[item].min * Config.gradeMultiplier[itemData.metadata.type], Config.sellPrice[item].max * Config.gradeMultiplier[itemData.metadata.type]))
end
exports.ox_inventory:RemoveItem(source, item, 1, nil, itemData.slot)
exports.ox_inventory:AddItem(source, 'money', reward) -- line 65
end
end)
Do you know what the error means? I'm at a loss. And the original script dev has archived the script so I'm kinda stuck. Script was made for ox inv 2.7.4. If it matters or not. I've tried looking at the documentation for ox inv but no luck figuring out this error. Thank you for your input.
The text was updated successfully, but these errors were encountered:
I've got a script where I'm selling an animal carcass from hunting. Unfortunately its giving me an error during the money part. Please see:
Here is the function:
In the config
Do you know what the error means? I'm at a loss. And the original script dev has archived the script so I'm kinda stuck. Script was made for ox inv 2.7.4. If it matters or not. I've tried looking at the documentation for ox inv but no luck figuring out this error. Thank you for your input.
The text was updated successfully, but these errors were encountered: