So I am trying make a code execute if both conditions are true. I put a || because that is what you do in java but it does not work. How do you do and statements in lua?
if script.Parent.Parent.Parent.Parent.Parent.Work.Frame.Frame.Slot1.Visible == true || script.Parent.Parent.Parent.Parent.Parent.Work.Frame.Frame.Slot2.Visible == true then
It is pretty straight-foward, actually, there is a conditional lua statement called and
, which stands for both variables that you use. For example, you would do;
if script.Parent.Parent.Parent.Parent.Parent.Work.Frame.Frame.Slot1.Visible == true and script.Parent.Parent.Parent.Parent.Parent.Work.Frame.Frame.Slot2.Visible == true then -- blah blah blah end -- or if condition1 == true and condition2 == true then -- blah blah blah end
Scroll down to Logical Operators here: https://developer.roblox.com/en-us/articles/Conditional-Statements-in-Lua