Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Any way to find a player's quality level?

My game contains a lot of moving parts (mostly decoration), causing lag in most people who play it. If I could find a way to find what quality level a player is set at, I could reduce the amount of these moving pieces accordingly. Like,

if player.qualitycontrol < 5 then
	movingpartsspawned = 10
end

Is this possible? If not, any other suggestions to reduce lag in a game?

1 answer

✓ Accepted answer

There is! You can find the users initial quality level by calling the function UserSettings() and checking the value of it's property GameSettings's property SavedQualityLevel.

UserSettings().GameSettings.SavedQualityLevel.Value

However, you will have to keep track of changes to the quality level on your own. You can conveniently do this with an event of DataModel .

local CurrentGraphicsQualityLevel = UserSettings().GameSettings.SavedQualityLevel.Value

game.GraphicsQualityChangeRequest:connect(function(graphicsIncrease)
	local amount = graphicsIncrease and 1 or -1
	local level = CurrentGraphicsQualityLevel  + amount
	if level > 10 then
		level = 10
	elseif level < 1 then
		level = 1
	end
	CurrentGraphicsQualityLevel  = level
end)

1 comment

0

UserSettings().GameSettings.SavedQualityLevel.Value returns 0 when the quality level is set to "Automatic". Haven't tried the code after that yet.

This discussion is preserved as it was. New answers, comments, and votes are closed.