Setting a variable value depending on a lever powered state

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Tarantula

Member
Apr 8, 2021
2
0
1
25
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:
on rightclick on lever:
  if distance between event-block and 15 15 15 is 1:
    if {bombarmed} is true:
      set {bombarmed} to false
    else if {bombarmed} is false:
      set {bombarmed} to true

on rightclick on button:
  if distance between event-block and 12 12 12 is 1:
    if {bombarmed} is true:
      # calling function to activate bomb.
[doublepost=1623431027,1623421785][/doublepost]Note: This doesn't work for me
 
Status
Not open for further replies.