hello I was doing a settings gui but when I press the option should be deactivated but instead of deactivating it remains the same this is my script
script.Parent.Activator.MouseButton1Click:Connect(function()
script.Parent.Frame.Visible = not script.Parent.Frame.Visible
end)
script.Parent.Frame.Bloom.MouseButton1Click:Connect(function()
if script.Parent.Frame.Bloom.Text == “Bloom : On” then
script.Parent.Frame.Bloom.Text = “Bloom: Off”
game.Lighting.Bloom.Enabled = false
elseif script.Parent.Frame.Bloom.Text == “Bloom: Off” then
script.Parent.Frame.Bloom.Text = “Bloom: On”
game.Lighting.Bloom.Enabled = true
end
end)
script.Parent.Frame.Blur.MouseButton1Click:Connect(function()
if script.Parent.Frame.Blur.Text == “Blur : On” then
script.Parent.Frame.Blur.Text = “Blur: Off”
game.Lighting.Blur.Enabled = false
elseif script.Parent.Frame.Blur.Text == “Blur: Off” then
script.Parent.Frame.Blur.Text = “Blur: On”
game.Lighting.Blur.Enabled = true
end
end)
script.Parent.Frame.ColorCorrection.MouseButton1Click:Connect(function()
if script.Parent.Frame.ColorCorrection.Text == “ColorCorrection : On” then
script.Parent.Frame.ColorCorrection.Text = “ColorCorrection: Off”
game.Lighting.ColorCorrection.Enabled = false
elseif script.Parent.Frame.ColorCorrection.Text == “ColorCorrection: Off” then
script.Parent.Frame.ColorCorrection.Text = “ColorCorrection: On”
game.Lighting.ColorCorrection.Enabled = true
end
end)
script.Parent.Frame.AllEffects.MouseButton1Click:Connect(function()
if script.Parent.Frame.AllEffects.Text == “All Effects: On” then
script.Parent.Frame.AllEffects.Text = “All Effects: Off”
for i, v in pairs(game.Lighting:GetChildren()) do
v.Enabled = false
end
elseif script.Parent.Frame.AllEffects.Text == “All Effects: Off” then
script.Parent.Frame.AllEffects.Text = “All Effects: On”
for i, v in pairs(game.Lighting:GetChildren()) do
v.Enabled = true
end
end
end)
script.Parent.Activator.MouseButton1Click:Connect(function()
script.Parent.Frame.Visible = not script.Parent.Frame.Visible
end)
script.Parent.Frame.Bloom.MouseButton1Click:Connect(function()
if script.Parent.Frame.Bloom.Text == “Bloom : On” then
script.Parent.Frame.Bloom.Text = “Bloom: Off”
game.Lighting.Bloom.Enabled = false
elseif script.Parent.Frame.Bloom.Text == “Bloom: Off” then
script.Parent.Frame.Bloom.Text = “Bloom: On”
game.Lighting.Bloom.Enabled = true
end
end)
script.Parent.Frame.Blur.MouseButton1Click:Connect(function()
if script.Parent.Frame.Blur.Text == “Blur : On” then
script.Parent.Frame.Blur.Text = “Blur: Off”
game.Lighting.Blur.Enabled = false
elseif script.Parent.Frame.Blur.Text == “Blur: Off” then
script.Parent.Frame.Blur.Text = “Blur: On”
game.Lighting.Blur.Enabled = true
end
end)
script.Parent.Frame.ColorCorrection.MouseButton1Click:Connect(function()
if script.Parent.Frame.ColorCorrection.Text == “ColorCorrection : On” then
script.Parent.Frame.ColorCorrection.Text = “ColorCorrection: Off”
game.Lighting.ColorCorrection.Enabled = false
elseif script.Parent.Frame.ColorCorrection.Text == “ColorCorrection: Off” then
script.Parent.Frame.ColorCorrection.Text = “ColorCorrection: On”
game.Lighting.ColorCorrection.Enabled = true
end
end)
script.Parent.Frame.AllEffects.MouseButton1Click:Connect(function()
if script.Parent.Frame.AllEffects.Text == “All Effects: On” then
script.Parent.Frame.AllEffects.Text = “All Effects: Off”
for i, v in pairs(game.Lighting:GetChildren()) do
v.Enabled = false
end
elseif script.Parent.Frame.AllEffects.Text == “All Effects: Off” then
script.Parent.Frame.AllEffects.Text = “All Effects: On”
for i, v in pairs(game.Lighting:GetChildren()) do
v.Enabled = true
end
end
end)
for those who want to read it, though its really ugly by itself, OP i suggest making local variables because no one likes seeing script.parent everywhere
If you are referring to those red lines in the picture you sent, the Quotation Marks you used in the script isn’t consider as a regular text so roblox can’t detect it.
script.Parent.Activator.MouseButton1Click:Connect(function()
script.Parent.Frame.Visible = not script.Parent.Frame.Visible
end)
script.Parent.Frame.Bloom.MouseButton1Click:Connect(function()
if script.Parent.Frame.Bloom.Text == “Bloom : On” then
script.Parent.Frame.Bloom.Text = “Bloom: Off”
game.Lighting.Bloom.Enabled = false
elseif script.Parent.Frame.Bloom.Text == “Bloom: Off” then
script.Parent.Frame.Bloom.Text = “Bloom: On”
game.Lighting.Bloom.Enabled = true
end
end)
script.Parent.Frame.Blur.MouseButton1Click:Connect(function()
if script.Parent.Frame.Blur.Text == “Blur : On” then
script.Parent.Frame.Blur.Text = “Blur: Off”
game.Lighting.Blur.Enabled = false
elseif script.Parent.Frame.Blur.Text == “Blur: Off” then
script.Parent.Frame.Blur.Text = “Blur: On”
game.Lighting.Blur.Enabled = true
end
end)
script.Parent.Frame.ColorCorrection.MouseButton1Click:Connect(function()
if script.Parent.Frame.ColorCorrection.Text == "ColorCorrection : On"then
script.Parent.Frame.ColorCorrection.Text = “ColorCorrection: Off”
game.Lighting.ColorCorrection.Enabled = false
elseif script.Parent.Frame.ColorCorrection.Text == “ColorCorrection: Off” then
script.Parent.Frame.ColorCorrection.Text = “ColorCorrection: On”
game.Lighting.ColorCorrection.Enabled = true
end
end)
script.Parent.Frame.AllEffects.MouseButton1Click:Connect(function()
if script.Parent.Frame.AllEffects.Text == "All Effects: On"then
script.Parent.Frame.AllEffects.Text = “All Effects: Off”
for i, v in pairs(game.Lighting:GetChildren()) do
v.Enabled = false
end
elseif script.Parent.Frame.AllEffects.Text == "All Effects: Off"then
script.Parent.Frame.AllEffects.Text = “All Effects: On”
for i, v in pairs(game.Lighting:GetChildren()) do
v.Enabled = true
end
end
end)
I rewrote it, you can try that one above, but if that however is not the case you can explain it more. It seems you copied and just rewrote so I think that was the case.
There’s a space before the colon, which is probably what’s causing the game to skip over this statement.
In addition, the Devforum automatically converts the straight quotation marks that Luau recognizes into right and left quotes, which is why the script is erroring when you copy it into Roblox. Try this:
script.Parent.Activator.MouseButton1Click:Connect(function()
script.Parent.Frame.Visible = not script.Parent.Frame.Visible
end)
script.Parent.Frame.Bloom.MouseButton1Click:Connect(function()
if script.Parent.Frame.Bloom.Text == "Bloom: On" then
script.Parent.Frame.Bloom.Text = "Bloom: Off"
game.Lighting.Bloom.Enabled = false
elseif script.Parent.Frame.Bloom.Text == "Bloom: Off" then
script.Parent.Frame.Bloom.Text = "Bloom: On"
game.Lighting.Bloom.Enabled = true
end
end)
script.Parent.Frame.Blur.MouseButton1Click:Connect(function()
if script.Parent.Frame.Blur.Text == "Blur: On" then
script.Parent.Frame.Blur.Text = "Blur: Off"
game.Lighting.Blur.Enabled = false
elseif script.Parent.Frame.Blur.Text == "Blur: Off" then
script.Parent.Frame.Blur.Text = "Blur: On"
game.Lighting.Blur.Enabled = true
end
end)
script.Parent.Frame.ColorCorrection.MouseButton1Click:Connect(function()
if script.Parent.Frame.ColorCorrection.Text == "ColorCorrection: On" then
script.Parent.Frame.ColorCorrection.Text = "ColorCorrection: Off"
game.Lighting.ColorCorrection.Enabled = false
elseif script.Parent.Frame.ColorCorrection.Text == "ColorCorrection: Off" then
script.Parent.Frame.ColorCorrection.Text = "ColorCorrection: On"
game.Lighting.ColorCorrection.Enabled = true
end
end)
script.Parent.Frame.AllEffects.MouseButton1Click:Connect(function()
if script.Parent.Frame.AllEffects.Text == "All Effects: On" then
script.Parent.Frame.AllEffects.Text = "All Effects: Off"
for i, v in pairs(game.Lighting:GetChildren()) do
v.Enabled = false
end
elseif script.Parent.Frame.AllEffects.Text == "All Effects: Off" then
script.Parent.Frame.AllEffects.Text = "All Effects: On"
for i, v in pairs(game.Lighting:GetChildren()) do
v.Enabled = true
end
end
end)