1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setting a variable value depending on a lever powered state

Discussion in 'Skript' started by Tarantula, Jun 11, 2021 at 3:29 PM.

Tags:
  1. Tarantula

    Tarantula Member

    Joined:
    Apr 8, 2021
    Messages:
    2
    Likes Received:
    0
    So I am trying to set a variable to true when lever at 15 15 15 is powered and set the variable to false when lever is unpowered. And then pressing a button calls an if statement that checks if the var as mentioned before is true. If it is it calls a function. The button location is 12 12 12.
    Code (Text):
    1. on rightclick on lever:
    2.   if distance between event-block and 15 15 15 is 1:
    3.     if {bombarmed} is true:
    4.       set {bombarmed} to false
    5.     else if {bombarmed} is false:
    6.       set {bombarmed} to true
    7.  
    8. on rightclick on button:
    9.   if distance between event-block and 12 12 12 is 1:
    10.     if {bombarmed} is true:
    11.       # calling function to activate bomb.
    --- Double Post Merged, Jun 11, 2021 at 6:03 PM, Original Post Date: Jun 11, 2021 at 3:29 PM ---
    Note: This doesn't work for me
     

Share This Page

Loading...