I’m in the process of creating a menu with NativeUI. I have the menu working, and the sub menu shows as expected. Although I’m not 100% sure how to ‘action’ my presses on the Sub Menu if that makes sense.
I get no errors with the F8 Console, so I have a feeling it’s a simple fix within my if statement.
There’s a video below showing what happens.
function jsocMainMenu(menu)
--Creates the Main Menu for the Role Select
local roleSelect = _menuPool:AddSubMenu(menu, "Role Select")
menu:AddItem(roleSelect)
--This is the Role Select Sub-Menu (Rifleman, Auto Rifleman, Medic)
roleSelect:AddItem(NativeUI.CreateItem("Rifleman",""))
roleSelect:AddItem(NativeUI.CreateItem("Auto Rifleman",""))
roleSelect:AddItem(NativeUI.CreateItem("Medic",""))
--Where the Action would take place within the SubMenu
roleSelect.OnItemSelect = function(sender, item, index)
if item == roleSelect then
TriggerEvent("chatMessage", "I Work")
end
end
end
If you need anymore info, please let me know.