Menu
Login
Language
DE EN FR ES IT CZ
Back

Keypad Code Puzzle

  • #1, by eric-tritten Wednesday, 24. September, 04:35 2 months ago Quote
    I am trying to create a keypad code puzzle.  I have created object for each key (1,2 & 3).  Each obejct has the execute scrip action with the following code: Values["keypad_input"].String = Values["keypad_input"].String .. "1".

    When the key is pressed it adds 1, 2 or 3 to the Value string.  I then created a Value with the password (123) in the string.

    I have an object for enter button with action "if value".  Value 1 (keypad_input) is compared to Value 2 (password 123).  I have it set to equal and play a sound to test.

    When running the scene, the keys selected are added to the Value String, and when I click enter, it plays the sound, but if I enter the wrong code it still plays the sound.

    I know i am going down the wrong path, so I appreciate the help, thank you.

    Newbie

    6 Posts

  • #2, by esmeralda Wednesday, 24. September, 15:36 2 months ago Quote
    the action part "if value" will only compare the integer of the value, not the string.
    To compare the string use the "if lua..." action part.

    return Values["keypad_input"].String == Values["password"].String




    Key Killer

    567 Posts

  • #3, by eric-tritten Thursday, 25. September, 06:23 2 months ago Quote
    the action part "if value" will only compare the integer of the value, not the string.
    To compare the string use the "if lua..." action part.

    return Values["keypad_input"].String == Values["password"].String




    That worked, thank you so much!

    Newbie

    6 Posts

Write post