Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help with "attempt to index nil with SavedQualityLevel"?

Asked by 4 years ago
Edited 4 years ago

It gives me the error "Attempt To Index Nil With SavedQualityLevel" and i just cant seem to find out why

local GameSettings = game:GetService("UserGameSettings")
local Valid = false


    for i = 1,50 do
        wait(1)
        if GameSettings.SavedQualityLevel == Enum.QualityLevel.Level08 or GameSettings.QualityLevel == Enum.QualityLevel.Level09 or GameSettings.QualityLevel == Enum.QualityLevel.Level10 then
            Valid = true
            print(Valid)
        elseif not GameSettings.SavedQualityLevel == Enum.QualityLevel.Level08 or not GameSettings.QualityLevel == Enum.QualityLevel.Level09 or not GameSettings.QualityLevel == Enum.QualityLevel.Level10  then
            Valid = false
            print(Valid)
        end
    end

I'm Trying to check if the SavedQualityLevel is 8 or above So if it is not too much to ask please help?

0
That is because SavedQualityLevel is nil. It's usergamesettings, NOT gamesettings. WideSteal321 773 — 4y

Answer this question