Issues with Calculations #222

  • New
  • BLiTz_BaNe created this issue Aug 30, 2020

    command: /calc
    type: RUN_COMMAND
    #required_args: 1
    permission-required: true
    - $Script$%if%$arg1.isanumber
    - $Script$%if%$arg3.isanumber
    - $Script$%PlayerData%calc1=$arg1
    - $Script$%if%$arg2==add
    - $Script$%PlayerData%calc1+$arg3
    - $text$$PlayerData%calc1%

    I'm trying to use this to calculate $arg1 and $arg3 and whenever I type /calc 1 add 1, it gives me random 2's and 1's every time I type the command. Is there any way to resolve this or is there any method that I can use to fix this? Thank you.

  • BLiTz_BaNe added a tag New Aug 30, 2020
  • LuisGerardo7071 posted a comment Sep 1, 2020
    I still do not have a simple solution, but possibly the operation on occasions will be solved first and on others not (later), in relation to the message.

    Try using /mycmd-playerdata check, if the variable always shows the operation correctly, it confirms the above,
    but if it changes, the variables may be saved in a different order. Also try using different numbers to see/understand what the problem is and/or locate it (ex: /calc 2 add 3).

    If you use PlaceholdersAPI try using the Math expansion (/papi ecloud download Math) and use: $text$%math_$arg1+$arg3[precision:0]%.

    Edited Sep 1, 2020
  • BLiTz_BaNe posted a comment Sep 7, 2020

    Yhup. I chekced the mycmd-playerdata check and it randomly set to 1 and 2 . I also have some concerns with the same issue as when giving experience points. If I multiply 250 into how many exp they want to purchase, it randomly sets to 9 million and I don't know why. By the way, thank you for suggesting about the Math. Will definitely use this instead.


To post a comment, please login or register a new account.