Attempt to index nil with 'SavedQualityLevel' Issue

I’m making a high graphics system.i made it but then i experienced the index nil issue.it wasnt happening before.


the script is also client.

tried searching on google but theres no forum about this.i became nervous.

Any ideas to fix this?
script:

task.wait(5)
local TS = game:GetService("TweenService")
local Lightning = game:GetService("Lighting")
local Enabled = false

script.Parent.MouseButton1Click:Connect(function()
	script.Effect:Play()
	if game:GetService("UserGameSettings").SavedQualityLevel.Value >= 8 then
		if Enabled then
			TS:Create(script.Parent.UIStroke,TweenInfo.new(0.25,Enum.EasingStyle.Quad),{Color = Color3.fromRGB(255,0,0)}):Play()
			TS:Create(script.Parent,TweenInfo.new(0.25,Enum.EasingStyle.Quad),{TextColor3 = Color3.fromRGB(255,0,0)}):Play()
			Lightning.SunRays.Enabled = false
			Lightning.DepthOfField.Enabled = false
			Enabled = false
		else
			TS:Create(script.Parent.UIStroke,TweenInfo.new(0.25,Enum.EasingStyle.Quad),{Color = Color3.fromRGB(0,255,0)}):Play()
			TS:Create(script.Parent,TweenInfo.new(0.25,Enum.EasingStyle.Quad),{TextColor3 = Color3.fromRGB(0,255,0)}):Play()
			Lightning.SunRays.Enabled = true
			Lightning.DepthOfField.Enabled = true
			Enabled = true
		end
	else
		TS:Create(script.Parent.Parent.HighGraphicsWarning,TweenInfo.new(0.25,Enum.EasingStyle.Quad),{GroupTransparency = 0}):Play()
		TS:Create(script.Parent.Parent.HighGraphicsWarning.UIStroke,TweenInfo.new(0.25,Enum.EasingStyle.Quad),{Transparency = 0}):Play()
		script.Parent.Parent.HighGraphicsWarning.Description.Text = "Grafik seviyen 8 ile eşit veya yüksek olması gerekiyor.Çünkü yüksek grafiklerin çalışabilmesi için 8. grafik seviyesi gerekiyor.Kullandığın mevcut grafik seviyesi ise "..GameSettings.SavedQualityLevel.Value..".Grafik seviyeni 8'e çekerek sorunu düzeltebilirsin."
		script.Error:Play()
	end
end)
1 Like

the given error indicates that “SavedQualityLevel” doesnt exist

The service is built into the UserSettings singleton, so you would access it like so:

UserSettings():GetService("UserGameSettings")
1 Like

yeah,but when i type the SavedQualityLevel word the shortcut appears as enum.

ill try your idea if it works thank you.

still doesnt works.i have no idea why this is happening.

oh my fault! forgot a line to change with UserSettings.sorry!it worked now.

is this a new method for accessing qualitylevel?

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