Login / Registrieren
DE EN FR ES IT CZ
Back

Keypad Code Puzzle

  • #1, von eric-tritten Wednesday, 24. September 2025, 04:35 4 months ago
    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.

    eric-tritten


    Newbie

    7 Posts

  • #2, von esmeralda Wednesday, 24. September 2025, 15:36 4 months ago
    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




    esmeralda


    Key Killer

    569 Posts

  • #3, von eric-tritten Thursday, 25. September 2025, 06:23 4 months ago
    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!

    eric-tritten


    Newbie

    7 Posts