Im trying to make a discord donator car menu, using ace perms to spawn cars.
local SAHPVehicles = _MenuPool:AddSubMenu(MainMenu, Config.SAHPName, "Choose a pack!", true)
if SAHPVehicle1() then
local SAHP1 = NativeUI.CreateItem(Config.SAHPVehicleName1, "")
if IsAceAllowed(source, "donatorone") then
SAHP1.Activated = function(ParentMenu, SelectedItem)
notify("~y~Error: ~w~You don't have the required permission to spawn this vehicle.")
I get the error:
SCRIPT ERROR: Execution of native 000000007ebb9929 in script host failed: Argument at index 0 was null.
IsPlayerAceAllowed is a server side native and you’re attempting to call it from the client, you can use IsAceAllowed instead. Alternatively (assuming you’re using OneSync) create an event and have the server spawn the vehicle for the player if they pass your check, having the server spawn entities instead of the client is considered a better practice anyway.