I need help with lists

  • 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.
Mar 9, 2018
2
0
1
Hungary, Debrecen
So I want to create a list that stores signs location. But I don't no how to remove a specify sign location. So I need a help.

There is my code of the sign place:
code_language.skript:
on sign change:
    if line 1 is "[Buy]":
        if line 2 is set:
            if line 3 is set:
                if line 4 is set:
                    set {_q} to "%uncolored line 2%" parsed as a integer
                    set {_i} to "%uncolored line 3%" parsed as a item
                    set {_p} to "%uncolored line 4%" parsed as a number
                    replace all "$" with "" in {_p}
                    set line 1 to "&2[Buy]"
                    set line 2 to "&0%{_q}%"
                    set line 3 to "&0%{_i}%"
                    set line 4 to "&a$%{_p}%"
                    add location of event-block to {sign.buy.locations::*}
                    broadcast "%{sign.buy.locations::*}%"
And this is the remove code:
code_language.skript:
on break:
    if event-block is a sign:
        if location of event-block is {sign.buy.location::*}:
            remove loop-value from {sign.buy.location::*}

Sorry bad english, and thanks for helping me!
 
At the delete part, you have to check if the list contains the location of the event sign
 
That is not a correct check as it won't work when you have more values on the list. You have to loop the list, check if the loop value is the sign location and then delete it
 
Status
Not open for further replies.