double instance of value added to list.

  • 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 community!

    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.

lohmann99

New Member
Oct 21, 2020
6
0
1
When i use this marker i made it adds an extra copy of the blocks position, to the list, and i can't figure out why.

Code:
# Marker will save a right clicked blocks position
on rightclick:
    if {marker} is true:
        set {_new_pos} to location of clicked block
        add {_new_pos} to {marker::*}

        message "Marker added: (%{_new_pos}%)"
        message "Current Markers:"
        loop {marker::*}:
            message "(%loop-value%)"

so the output becomes:

Code:
[11:30:10 INFO]: Current Markers:
[11:30:10 INFO]: (x: 11.5, y: 64.5, z: 5.5)
[11:30:10 INFO]: (x: 11.5, y: 64.5, z: 5.5)
[11:30:10 INFO]: (x: 13.5, y: 65.5, z: 5.5)

as you can see the first position is added twice.
 
Status
Not open for further replies.