Profile image

[QUESTION+HELP] Is there a way to press a button and have it unpress by itself a few seconds later?

3,340 JustWingIt  2.2 years ago
  • Log in to leave a comment
  • Profile image
    3,340 JustWingIt

    @hpgbproductions Thanks! It's ok, my thing doesn't have to be perfect. I'm trying to remaster my Ao Jun with all the latest tech before I make the Seraph from War Robots

    +1 2.2 years ago
  • Profile image

    @JustWingIt to change the time, change the 1 in MyButton variable
    Stopping the button from being pressed is more complicated, I tried it and I don't know how to do it without actual trickery (pistons or storing a whole lot more variables)

    +2 2.2 years ago
  • Profile image
    3,340 JustWingIt

    @hpgbproductions Thanls so much BTW, I'll credit you

    +1 2.2 years ago
  • Profile image
    3,340 JustWingIt

    @hpgbproductions And, is there a way to stop a button from being able to be pressed for a certain amount of time?

    +1 2.2 years ago
  • Profile image
    3,340 JustWingIt

    @hpgbproductions How would I adjust the code to change the seconds for which the button stays pressed?

    +1 2.2 years ago
  • Profile image

    @JustWingIt yes it works with a light using the same input as the button

    +2 2.2 years ago
  • Profile image
    3,340 JustWingIt

    @hpgbproductions Can't download it right now, but I will when I get home. I assume that if you hook this up to a light, for example, it would stay on until the button unpresses itself?

    +1 2.2 years ago
  • Profile image

    Tried to make something
    Yeah
    Button has interactionType=Toggle and outputs to MyButton
    .
    MyTimer = smooth(MyButton=1 ? 999999 : 0, MyButton=1 ? 1 : 999999)
    This uses an alternative to the sum function which can be reset.
    .
    MyButton = MyTimer > 1 ? 0 : MyButton
    Write 0 to MyButton if the timer is at more than 1 second, otherwise don't change the value
    You can also use a variable activation group

    +2 2.2 years ago