I’m almost done with a script, but I have one problem, one line has an error, can anyone help?
Script: local Website = script.Parent.Parent.Parent local player = game.Players.LocalPlayer local Create = script.Parent.Parent.Parent.Create local Friends = script.Parent.Parent.Parent.Friends local Games = script.Parent.Parent.Parent.Games local Home = script.Parent.Parent.Parent.Home local Settings = script.Parent.Parent.Parent.Settings
After I capitalized it, it still has the same error, I’m not sure if it shows up in the script on the dev-forum website, the error is: script.Parent.mouseButton1Click:Connect(function() script.Parent.Parent.Parent.Parent.DarkMode.Value == true else script.Parent.Parent.Parent.Parent.DarkMode.Value == false
if script.Parent.Parent.Parent.Parent.DarkMode.Value then
print("Is Dark Mode!")
else
print("Not Dark Mode!")
end
since it’s a bool value it will check the DarkMode value if it’s true without needing the “== true” part and else will mean it will be what happens if it’s false.
If you just want to check if it’s false without the else or == false then just do this:
if not script.Parent.Parent.Parent.Parent.DarkMode.Value then
print("Not Dark Mode!")
end
I use that since it’s much easier and cleaner, but with what I know brings no performance impacts and is all down to preference to what you want to use to check BoolValues
if script.Parent.Parent.Parent.Parent.DarkMode.Value == true then
end
And just use an if-else instead of a if-elseif because its either true or false and you don’t need to check the second statement. If the first is false, then the second will always be true.