So Im trying to make a script where when a button is clicked, the player’s graphics are lowered. But on line 10 I keep getting an error.
– get the button
local Players = game:GetService(“Players”)
local player = Players.LocalPlayer – get the local player
local gui = player:WaitForChild(“PlayerGui”) – get the PlayerGui
local button = gui.ScreenGui.Button – get the button
– function to lower the graphics
local function lowerGraphics()
local userSettings = game:GetService(“UserSettings”)
local gameSettings = userSettings.GameSettings
gameSettings.GraphicsMode = Enum.GraphicsMode.NoGraphics
end
– connect the function to the button’s click event
button.Activated:Connect(lowerGraphics)