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

How could I fix my graphics level detector?

I'm trying to code a graphics level detector so that if the players graphics are at a certain level, the lighting technology changes, and a bunch of other stuff happens. I put this localscript in both starterplayerscripts and startercharacter scripts, didn't work. Script:

local Players = game:GetService("Players")


Players.PlayerAdded:Connect(function()
	if UserSettings().GameSettings.SavedQualityLevel >=8 then
		print("Graphics High")
	end
end)

Any help is appreciated

2 comments

0

I havent checked in alittle but I'm pretty sure LightingTechnology is locked and cannot be changed ingame through a script. So its not going to change even if the script was functional.

0

Could it be done through the server?

2 answers

✓ Accepted answer

SavedQualityLevel actually returns an Enum.

https://developer.roblox.com/en-us/api-reference/enum/SavedQualitySetting

You could get the value of the enum to compare it as a number. In the end your code would end up looking like this,

if UserSettings().GameSettings.SavedQualityLevel.Value >= 8 then
	-- ok
end

3 comments

0

I tried that, no luck, it's in StarterPlayerScripts, could that be why?

0

No, that shouldn't be a problem. You could only call UserSettings() on your client and you can only retrieve the settings from your client, not other players.

0

Worked, thank you

Try making this a nonlocal script and put it into server settings.

I am not too experienced, but when I did this it usually works

1 comment

0

But if it's not local it does it for everyone I'm trying to make it so the lighting technology changes on your local client depending on your graphics level

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