Solved Saving coordinates

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

saulienis

Supporter
May 27, 2022
4
0
1
31
Category: Coordinates

Suggested name: Coords saver

Spigot/Skript Version: 2.6.1

What I want:
A way to save multiple coordinates with a command. Either them being saved to a book, or the original .sk file

Ideas for commands: /coord 1, /coord 2 etc. Basically a command and a short description.

Ideas for permissions: Basic operator permission.

When I'd like it by: When ever it is convenient.

Thanks in advance , love the community :emoji_slight_smile:
 
This code accomplished the same purpose by saving the coordinates to an id, so if you do /coord 1, it'll assign your current coordinates to id 1, so if you run /coord 1 again it'll return the coordinates with id 1, same with 2, etc. etc.

Code:
command /coord [<number>]:
    usage: &cThe command is used like this » /coord (integer)
    trigger:
        if sender is op:
            set {_num} to arg-1
            if arg-1 is set:
                if arg-1 is an integer:
                    if {coords.%{_num}%.%uuid of player%} is not set:
                        set {coords.%{_num}%.%uuid of player%} to true
                        set {coords.x.%{_num}%.%uuid of player%} to player's x-coordinate
                        set {coords.y.%{_num}%.%uuid of player%} to player's y-coordinate
                        set {coords.z.%{_num}%.%uuid of player%} to player's z-coordinate
                        send "&cSaved your coordinates to the ID » %arg-1%" to sender
                    else:
                        send "&cCoordinate with ID %arg-1%&c » X: %{coords.x.%{_num}%.%uuid of player%}%&c Y: %{coords.y.%{_num}%.%uuid of player%}%&c Z: %{coords.z.%{_num}%.%uuid of player%}%" to sender
                        stop
                else:
                    send "&cThe number needs to be an integer!" to sender
                    stop
            else:
                send "&cSpecify a coordinate save value!" to sender
                stop
        else:
            send "&cYou cannot do this!" to sender
            stop
 
  • Like
Reactions: saulienis