Try this, if it doesn’t I’ll look to fix it tomorrow, it seems strange to me that it worked for some people and not for others.
ESX = exports[“es_extended”]:getSharedObject()
local FPSConfig = {
pedstreaming_max_time = 0.1,
entitystreaming_max_time = 0,
lodscale = 2,
lodmult = 1.0,
ShadowDepthBias = 0.01,
ShadowNearClip = 0.01,
MaxLightsPerCluster = 50.0,
grass_quality = 5.0,
fxaa_quality = 3.0,
farclip = 2000.0,
particle_quality = 2.0,
shadow_quality = 5.0,
shadowsoftness = 1.0,
texture_quality = 2.0,
water_quality = 4.0,
water_wavelets = 0.0,
vehicledensity = 0.0,
vehiclestreaming_priority_multiplier = 0.0,
StreamingMaxVehicleCullDistanceScale = 0.0,
MaxVehicleCullDistance = 0.0
}
local OriginalConfig = {}
local MenuOption = {
{
name = “FPS ON”,
function = function()
– Save original config
for key, value in pairs(FPSConfig) do
OriginalConfig[key] = GetResourceKvpFloat(key) or 0.0
end
-- Apply FPS config
for key, value in pairs(FPSConfig) do
SetResourceKvpFloat(key, value)
end
print("Performance options configured to increase FPS.")
end
},
{
name = "FPS OFF",
function = function()
-- Restore original config
for key, value in pairs(OriginalConfig) do
SetResourceKvpFloat(key, value)
end
ESX.ShowNotification("FPS settings restored to their default values.")
end
}
}
while true do
Citizen.Wait(0)
if IsControlJustPressed(0, 168) then -- "F7" key to open the menu
OpenMenu(MenuOption)
end
end
end)
function OpenMenu(options)
local elements = {}
for _, option in ipairs(options) do
table.insert(elements, {label = option.name})
end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'menu', {
title = 'FPS Menu',
align = 'bottom-left',
elements = elements
}, function(data, menu)
local selectedOption = options[data.current.index]
selectedOption.function()
end, function(data, menu)
menu.close()
end)
end