Hello, I want to open a dialog menu to input how much of an item a player wants to throw away (into a garbage can). Whenever I try to open that menu, it opens for like 1 millisecond and disappears right after. Then I am in a locked state, where I can only move around a cursor, but not do anything (as if I was in the menu, but without the menu).
function OpenQuantityMenu(value)
print('Opening Quantity menu for item ' .. value)
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'openquantitymenu', {
title = 'How many?'
}, function(data, menu)
local quantity = data.value
TriggerServerEvent('dv_garbage:removeItem', value, 1)
menu.close()
end, function(data, menu)
menu.close()
end)
end
Whenever I try to press Enter in this state, following error appears in the console:
I hope any of you have an idea on how to solve this.