[Solved] Set two values in a conditional LUA statement

0

Hi all,

I am working on a script that will take a user input and set some hidden values. In particular, I would like it to set two values. I can get it to work with one value, but not two. Here is the working code:

 

id= 2;

if getvalue(id) == “Blue” then setvalue(8,”Blue”)
end

When I try to make it set two values, it does not work:

id= 2;

if getvalue(id) == “Blue” then (setvalue(8,”Blue”) and setvalue(9,”Color”))
end

Any suggestions on how to fix this?

Anthony Schmidt selected answer

    Best answer

    0

    The solution was really simple!

    id= 2;

    if getvalue(id) == “Blue” then (setvalue(8,”Blue”) setvalue(9,”Color”))
    end

    No need to include “and”.

    Anthony Schmidt selected as best answer
      ×

      Login

      Question stats

      • Active
      • Views136 times
      • Answers1 answer
      • Followers1 follower