NativeUI Help

I am trying to make a framework that uses NativeUI as it’s interface, but I can’t seem to open the menu. I added a print to see if anything even runs on player load, and it prints.

-- When Player Joins
AddEventHandler('playerSpawned', function()
    Citizen.Wait(100)
    print("loaded")
    TriggerEvent("PLIB:SHOWFRAMEWORK")
end)
RegisterNetEvent("PLIB:SHOWFRAMEWORK")
AddEventHandler("PLIB:SHOWFRAMEWORK", function()
    framework = true
    _menuPool = NativeUI.CreatePool()
    mainMenu = NativeUI.CreateMenu("Project Liberty", "~b~SELECT A CHARACTER")
    _menuPool:Add(mainMenu)
    
    function CreateChar(menu)
      local createCharBtn = NativeUI.CreateItem("Create Character", "Create a new character.")
      menu:AddItem(createCharBtn)
      menu.OnItemSelect = function(sender, item, index)
        if item == createCharBtn then
          print("creating new char")
        end
      end
    end

    CreateChar(mainMenu)
    _menuPool:RefreshIndex()
    mainMenu:Visible(not mainMenu:Visible())
end)

Above is the code I have for creating the menu as well as the event handler for when the player joins.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.