Solved Adding / Subtracting Numbers From Variables

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

Aidan

Member
Aug 7, 2020
12
0
1
28
I have a skript that has the following code. I have tried several different ways.

Code:
on block break:
    if event-block is white wool:
        subtract 1 from {gens.%player%}
        message "&cRemoving generator! &4(%{gens.%player%}%&4/25)

Code:
on break of white wool or black wool:
    if {gens.%player%} is not set:
        set {gens.%player%} to 0
    if {gens.%player%} is less than or equal to 25:
        subtract 1 from {gens.%player%}
        message "&cRemoving generator! &4(%{gens.%player%}%&4/25)"
    if {gens.%player%} is greater than 25:
        if block is white wool or black wool:
            stop

I don't get an error message.

I've been looking everywhere for the answer. I've even tried adding a simple thing that would point out if the code worked, like adding broadcast "Hi". Nothing has worked, can someone help me please?
 
Code:
on break of wool:
  remove 1 from {%player%.gens}
  send "&aYou removed a gen"

Maybe try doing something like this?
 
Code:
on break of wool:
  remove 1 from {%player%.gens}
  send "&aYou removed a gen"

Maybe try doing something like this?
I figured it out if anyone wants the answer, it's:
subtract 1 from {variable}
 
Status
Not open for further replies.