This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Script - how to end script if true
#2
You can do this on a few ways.

1) You can return before second if

Code:
if temp1 < temp2 then
  -- do something
  return -- could be with some value
end

if temp3 < temp4 then
 -- do something
end


2) You can nest your second if in the first

Code:
if temp1 < temp2 then
-- do something

 if temp3 < temp4 then
   -- do something
 end

end

3) If in the first if there is only this secondd you can combine your conditions with AND gate

Code:
if temp1 < temp2 and temp3 < temp4 then
  -- do something
end
Done is better than perfect
Reply


Messages In This Thread
RE: Script - how to end script if true - by buuuudzik - 01.11.2018, 04:44

Forum Jump: