Solved Negative value by resuming a value

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

Aralwen

Active Member
May 26, 2017
164
14
18
25
Hello ! I have a pretty annoying problem. I have a number in a value, I want to transcribe this number under the negative by resuming the value set before

For example, in {Border} there are 500. I would like that in {BorderNegative} it display -500
by resuming {Border}

I totally block, thanks in advance to those who will help me

Code:

In line 4, I do not see how to add a - before the value

code_language.skript:
command /borderdefine:
    trigger:
        set {Border} to 500
        set {BorderNegative} to {Border}

command /info:
    trigger:
        send "Border: %{Border}%"
        send "Border Negative: %{BorderNegative}%"
 
Alternatively:
code_language.skript:
command /borderdefine:
    trigger:
        set {Border} to 500
        set {BorderNegative} to ({Border} * -1)

Multiplication with -1 always reverses the number
 
Alternatively:
code_language.skript:
command /borderdefine:
    trigger:
        set {Border} to 500
        set {BorderNegative} to ({Border} * -1)

Multiplication with -1 always reverses the number
Not bad as an alternative, thank's ! :emoji_smile:
 
  • Like
Reactions: jaylawl
Status
Not open for further replies.