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

How could I fix my graphics level detector?

Asked by 3 years ago

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

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. Benbebop 1049 — 3y
0
Could it be done through the server? julianhak06 12 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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
0
I tried that, no luck, it's in StarterPlayerScripts, could that be why? julianhak06 12 — 3y
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. Nickuhhhhhhhhhhhhhhh 834 — 3y
0
Worked, thank you julianhak06 12 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

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

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 julianhak06 12 — 3y

Answer this question