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.

Solved Different variables are seemingly the same

Discussion in 'Skript' started by CreeperOverLord7, Apr 13, 2022.

Thread Status:
Not open for further replies.
  1. CreeperOverLord7

    Joined:
    Jan 19, 2018
    Messages:
    17
    Likes Received:
    1
    Skript Version: 2.6.1
    Skript Authors: Njol, Mirreski, SkriptLang Team and Contributors
    Minecraft Version: 1.16.5 (Paper version git-Paper-794)

    Full Code:
    Code (Text):
    1. # set a and b
    2. set {a} to "00000000110101101010101011010110100000101101011010000010101110101010101010101010101110101000001011010110100000101000001010000010"
    3. set {b} to "00000000000000000000000000110000001100000011000000110000001100000011000000110000000000000011000000110000000000000000000000000000"
    4. # confirm that a != b
    5. broadcast "%true if {a} = {b} else false%"
    6. # list vars
    7. set {var::%{a}%::*} to 1, 2, 3
    8. set {var::%{b}%::*} to 4, 5, 6
    9. # now why is {var::%{a}%::*} = 4, 5, 6 ?
    10. broadcast "a: %{var::%{a}%::*}%"
    11. broadcast "b: %{var::%{b}%::*}%"
    12. # (presumably because they are the same variable, but that can't be!)
    Code output:
    upload_2022-4-13_18-28-21.png

    Expected output:
    Code (Text):
    1. a: 1, 2, 3
    2. b: 4, 5, 6
    (No errors, no addon syntax used)

     
  2. Best Answer:
    Post #3 by CreeperOverLord7, Apr 14, 2022
  3. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    148
    Likes Received:
    5
    Try {var %{a}%::*} and {var %{b}%::*} to see if the problem is the variable
    --- Double Post Merged, Apr 14, 2022, Original Post Date: Apr 14, 2022 ---
    You can also try {var::%{a}%}
     
  4. CreeperOverLord7

    Joined:
    Jan 19, 2018
    Messages:
    17
    Likes Received:
    1
    I managed to fix this, although not sure about exactly what is happening with the {a} and {b} indexes.
    I tried this with long strings of other characters (like UUIDs), and they seemed to work, so the problem is that the index contains a very large number. The fix was splitting up the numbers with some character, such as putting a hyphen "-" every 16 characters in the index.
    TL;DR Big indexes are OK, just not numbers.
     
    • Agree Agree x 1
  5. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    148
    Likes Received:
    5
    I dint know that
     
Thread Status:
Not open for further replies.

Share This Page

Loading...