Solved Can't remove location from list variable

  • 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 our Wiki for downloads and any other information about Skript!

Status
Not open for further replies.

Zyxed

Supporter
May 17, 2021
23
1
3
27
I've encountered a really weird problem, and I can't find the solution. I have 2 different tools that I use to add locations to list variable, and the other one would be used to remove location from list variable. BUT this one (if {br.mythic.chest.locations::*} contains {_loc}:emoji_slight_smile: is not working, even if the block coordinates are exactly the same, even pitch and yaw.

So I made a test event with on break of gold block, and in this one, when all of the code is inside of the same event, it works. Why? I don't understand. And no errors at all, everything else works fine.

Code:
#THIS CODE ADDS LOCATION INTO THE LIST VARIABLE
on block place of bedrock:
    if world of player is "alkumaailma":
        if name of player's tool is "Sijainti LISÄYS työkalu":
            #Normaalit arkut
            if {BR.adding.loc::%player's uuid%} is "normal":
                cancel event
                if {br.chest.locations::*} or {br.mythic.chest.locations::*} contains location of event-block:
                    send "&cTämä sijainti on jo lisätty!" to player
                    stop
                else:
                    add location of event-block to {br.chest.locations::*}
                    send "&6%location of event-block% &flisätty arkkujen sijainti ryhmään" to player
           
            #Myyttiset arkut
            else if {BR.adding.loc::%player's uuid%} is "mythic":
                cancel event
                if {br.mythic.chest.locations::*} or {br.chest.locations::*} contains location of event-block:
                    send "&cTämä sijainti on jo lisätty!" to player
                    stop
                else:
                    add location of event-block to {br.mythic.chest.locations::*}
                    send "&6%location of event-block% &flisätty myyttisten arkkujen sijainti ryhmään" to player

#THIS CODE SHOULD BROADCAST "DEBUG2" BUT IT DOES NOT!
on break of ender chest:
    if world of player is "alkumaailma":
        if name of player's tool is "Sijainnin POISTAMIS työkalu":
            if {BR.deleting.single.loc::%player's uuid%} is set:
                broadcast "Debug 1"
                cancel event
                set {_loc} to location of event-block
                broadcast "%{_loc}%"
                if {br.mythic.chest.locations::*} contains {_loc}:
                    broadcast "Debug 2"   #THIS IS NOT WORKING!

   

#WHY THIS ONE WORKS?   
on break of gold block:
    add location of event-block to {locations::*}
    broadcast "%{locations::*}%"
    set {_loc} to location of event-block
    broadcast "%{_loc}%"
    if {locations::*} contains {_loc}:
        broadcast "working"
 
SOLVED!

Chest had to be changed to some other block before trying to check and remove location from list variable. That's why it worked on the break of gold block event. Chest is not event-block or something..
 
Status
Not open for further replies.