Information:
- I am not getting any errors
- I already attempted this, it didn't work.
- The parent of the script game.StarterGui.GraphicsGui.GraphicsButton
- The script is a LocalScript
- When I click the button nothing happens.
- The folder :https://ibb.co/Kbc14Wj
Attempt:
local qualityhigh = true
function Click(mouse)
if qualityhigh == true then
script.Parent.Text = "Increase Graphics"
game.Workspace.HighQuality:Destroy()
qualityhigh = false
end
if qualityhigh == false then
script.Parent.Text = "Decrease Graphics"
local copy = game.Lighting.HighQuality:Clone()
copy.Parent = game.Workspace
qualityhigh = true
end
end
script.Parent.MouseButton1Down:connect(Click)
Edit: I fixed it by changing the parent and using elseif:
Answer:
local qualityhigh = true
function Click(mouse)
if qualityhigh == true then
script.Parent.Text = "Increase Graphics"
game.Workspace.HighQuality.Parent = game.Lighting
qualityhigh = false
elseif qualityhigh == false then
script.Parent.Text = "Decrease Graphics"
game.Lighting.HighQuality.Parent = game.Workspace
qualityhigh = true
end
end
script.Parent.MouseButton1Down:connect(Click)

2 comments
Do you want this on the client or on the server?
@Dovydas1118 Client