/giveitem not working

getting this error

SCRIPT ERROR: @esx_inventoryhud/server/main.lua:997 attempt to call a nil value (global ‘ValidateString’)
ref (@esx_inventoryhud/server/main.lua:997
ref (es_extended/server/functions.lua:131
SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:479 attempt to concatenate a nil value (local ‘err’)

Please send us the main.lua file, so we can help you there

main.lua (63.6 KB)

here is the file right here

would running an sql query some how change some of the lua code in the main file?

No a SQL Query can not change something in the filesystem (Just change the database, pay attention it can delete all data).

Your script use a function named ValidateString, but it is not declared anywhere. I guess you are missing here code maybe another server lua named like functions.lua maybe? Best is to contact the developer for that.

there is a functions.lua in our server folder…here is the validate part for the function

ValidateItem = function(type, xPlayer, fromSlot, toSlot, fromItem, toItem)
local reason
if not fromSlot then reason = ‘source slot is empty’ else
if toSlot then
if type == ‘freeslot’ and fromItem.count == fromSlot.count and toItem.count == toSlot.count then
reason = ‘item count mismatch’
elseif type == ‘split’ and (fromSlot.count - fromItem.count) + (toSlot.count - toItem.count) ~= 0 then
reason = ‘item count mismatch’
end
if fromSlot.name ~= toItem.name or toSlot.name ~= fromItem.name then
reason = ‘item name mismatch’
end
else
if fromSlot.count - fromItem.count > fromSlot.count then
reason = ‘item count mismatch’
end
if fromSlot.name ~= toItem.name then
reason = ‘item name mismatch’
end
end
end

Please send the whole script, so I can test it. But let’s overthink this now: why do you overwrite the default ESX commands? Why do you need it?

I think you have an issue in your fxmanifest because ValidateItem should be declared in main.lua but it isn’t

To clarify, the error was no reference to “ValidateString” not “ValidateItem”. The files may be loaded fine. The OP has not indicated there is any ValidateString function though.

Oh yeah, you’re right, I don’t realize that he sent the wrong function. Thanks for the clarification