So, I’m having trouble with my script, it’s not really a big deal, but just my little knowledge, so i’ve written some code which contains if else, well both code shows to increment a value from zero to one and from one to two, i want both to run at the same time just specified, but both run at the same time, when the event runs the value that should be increased once, but the value is increased twice because the if else is not separate, now I want to know how to separate the if else so that it doesn’t run together, here’s the code:
-- Frame1
if Fill == 0 then
Fill = 1
print(Fill)
ArFrame1.OFrame1.Visible = true
if order.O1 ~= "" then
ArFrame1.OFrame1.O1.Visible = true
ArFrame1.OFrame1.O1.Text = "- "..order.O1
end
if order.O2 ~= "" then
ArFrame1.OFrame1.O2.Visible = true
ArFrame1.OFrame1.O2.Text = "- "..order.O2
end
if order.O3 ~= "" then
ArFrame1.OFrame1.O3.Visible = true
ArFrame1.OFrame1.O3.Text = "- "..order.O3
end
end
-- Frame2
if Fill == 1 then
Fill = 2
print(Fill)
ArFrame1.OFrame2.Visible = true
if order.O1 ~= "" then
ArFrame1.OFrame2.O1.Visible = true
ArFrame1.OFrame2.O1.Text = "- "..order.O1
end
if order.O2 ~= "" then
ArFrame1.OFrame2.O2.Visible = true
ArFrame1.OFrame2.O2.Text = "- "..order.O2
end
if order.O3 ~= "" then
ArFrame1.OFrame2.O3.Visible = true
ArFrame1.OFrame2.O3.Text = "- "..order.O3
end
end
Output:
1
2
^ Run at the same times