This is because you may have had coded the resource.lua wrong. Could you post a screenshot of your resource.lua file
itās my fxmanifest.lua
fx_version 'adamant'
game 'gta5'
description 'emc911'
version '1.0.0'
client_scripts {
'@menuv/menuv.lua',
'config.lua',
'client/main.lua',
}
I used your code and worked fine for me. I used the following fxmanifest.lua
fx_version 'adamant'
game 'gta5'
lua54 'yes'
name 'MenuV'
version '1.0.0'
description 'FiveM menu libarary for creating menu\'s'
author 'ThymonA'
contact 'contact@arens.io'
url 'https://github.com/ThymonA/menuv/'
client_scripts {
'@menuv/menuv.lua',
'example.lua'
}
dependencies {
'menuv'
}
And your code inside example.lua
local assert = assert
local MenuV = assert(MenuV)
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'bottomleft', 255, 0, 0)
local menu2 = MenuV:CreateMenu('Demo 2', 'Open this demo menu in MenuV', 'topleft', 255, 0, 0)
local menu_button = menu:AddButton({ icon = 'š', label = 'Open Demo 2 Menu', value = menu2, description = 'YEA :D from first menu' })
local menu2_button = menu2:AddButton({ icon = 'š', label = 'Open First Menu', value = menu, description = 'YEA :D from second menu' })
local confirm = menu:AddConfirm({ icon = 'š„', label = 'Confirm', value = 'no' })
local range = menu:AddRange({ icon = 'ā½', label = 'Range Item', min = 0, max = 10, value = 0, saveOnUpdate = true })
local checkbox = menu:AddCheckbox({ icon = 'š”', label = 'Checkbox Item', value = 'n' })
local slider = menu:AddSlider({ icon = 'ā¤ļø', label = 'Slider', value = 'demo', values = {
{ label = 'Demo Item', value = 'demo', description = 'Demo Item 1' },
{ label = 'Demo Item 2', value = 'demo2', description = 'Demo Item 2' },
{ label = 'Demo Item 3', value = 'demo3', description = 'Demo Item 3' },
{ label = 'Demo Item 4', value = 'demo4', description = 'Demo Item 4' }
}})
--- Events
confirm:On('confirm', function(item) print('YOU ACCEPTED THE TERMS') end)
confirm:On('deny', function(item) print('YOU DENIED THE TERMS') end)
range:On('select', function(item, value) print(('FROM %s to %s YOU SELECTED %s'):format(item.Min, item.Max, value)) end)
range:On('change', function(item, newValue, oldValue)
menu.Title = ('MenuV %s'):format(newValue)
end)
slider:On('select', function(item, value) print(('YOU SELECTED %s'):format(value)) end)
confirm:On('enter', function(item) print('YOU HAVE NOW A CONFIRM ACTIVE') end)
confirm:On('leave', function(item) print('YOU LEFT OUR CONFIRM :(') end)
menu:On('switch', function(item, currentItem, prevItem) print(('YOU HAVE SWITCH THE ITEMS FROM %s TO %s'):format(prevItem.__type, currentItem.__type)) end)
menu2:On('open', function(m)
m:ClearItems()
for i = 1, 10, 1 do
math.randomseed(GetGameTimer() + i)
m:AddButton({ ignoreUpdate = i ~= 10, icon = 'ā¤ļø', label = ('Open Menu %s'):format(math.random(0, 1000)), value = menu, description = ('YEA! ANOTHER RANDOM NUMBER: %s'):format(math.random(0, 1000)), select = function(i) print('YOU CLICKED ON THIS ITEM!!!!') end })
end
end)
RegisterCommand("menutest", function(source, args, fullCommand)
print ("test")
MenuV:OpenMenu(menu)
print ("test2")
end, false)
I added the following in my server.cfg
start menuv
start menuv_example
Also take a look at this issue, maybe you did the same thing wrong:
The following may be your problem:
- You didnāt started menuv in your server.cfg
- Your using the master branch instead of Release version
https://github.com/ThymonA/menuv/releases
Hi, nice job Tigo, i have a question, How to put the menu on the middle right of the screen ?, thx.
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0)
Change topleft
to centerright
, if you want to know which positions out there, check:
https://thymona.gitbook.io/menuv-standalone-menu-for-fivem/enums/positions
Thx tigo and nice project, im making an admin menu, when i finish i will send here ^^
Version 1.1 is out now and has YTD banner support:
Just published the new documentation, hopefully, this will help you all further.
MenuV documentation: https://menuv.fivem.io/api/
Version 1.2 is out now and has OpenWith key bind support.
Many thanks for your all your efforts, Iāve only had a small play around so far with it but I will be shifting all of my menu related resources to this one because of how well it just works.
Iāll be sure to make Issues with repos or PRās if I find any undesired outcomes.
Again, Thank you.
If your missing functionalities, you can always request them and maybe they will be implemented.
Thank you for your message and if you have any questions, contact information can be found on my GitHub profile.
Version 1.4 is out now and has
- Colour support like:
^1
or~r~
etc. - Resources using MenuV doesnāt require a resource restart anymore.
-
:Close
function on menuās now work properly - Adding / Removing Items wonāt cause weird issues like: Random order, wrong item select etc.
Download:
this is really really good but seems like in the example.lua, the āOpen Demo 2 Menuā button doesnt do anything. no errors either, im confused but if there is a fix Iām probably gonna have to spend like 50 hours changing everything over XD
EDIT: I canāt get anything to print very confused, literally nothing is printing to the console. Just using the latest build, added this to example.lua
Print itās
print(āhiā)
lol
--- Create a menu
local menu = MenuV:CreateMenu(false, 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace')
--- Add a button
local close_button = menu:AddButton({ label = 'Close Menu' })
--- Register `event`
close_button:On('select', function(i)
print('hi')
end)
--- Assign a button
menu:OpenWith('keyboard', 'F1') -- Press F1 to open Menu
This doesnāt work in your resource? Also make sure you make a new resource that uses menuv.
Example Resource: menuv_example.zip (1.8 KB)
My favorite menu system so far! Easy to use, and very straightforward!
That said, is there any way to add graph selectors, or color select sliders in the description as seen in this video?
Sorry if I havenāt read through the docs enough yet to get the answerā¦ Quite swamped currently!
Those arenāt part of MenuV right now, thanks for giving this idea and will definitely be implemented.
The best NUI menu!
Position label and size inside the buttons would be dope!
EDIT: Oh, also a function to delete buttons/menus
If your have some feature requests for the next update, please put them here in the forum or on GitHub: