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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Saving coordinates

Discussion in 'Requests' started by saulienis, May 27, 2022.

  1. saulienis

    Supporter

    Joined:
    May 27, 2022
    Messages:
    4
    Likes Received:
    0
    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:
     
  2. Best Answer:
    Post #2 by Jos, Jun 24, 2022
  3. Jos

    Jos New Member

    Joined:
    Dec 24, 2021
    Messages:
    2
    Likes Received:
    1
    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 (Text):
    1. command /coord [<number>]:
    2.     usage: &cThe command is used like this » /coord (integer)
    3.     trigger:
    4.         if sender is op:
    5.             set {_num} to arg-1
    6.             if arg-1 is set:
    7.                 if arg-1 is an integer:
    8.                     if {coords.%{_num}%.%uuid of player%} is not set:
    9.                         set {coords.%{_num}%.%uuid of player%} to true
    10.                         set {coords.x.%{_num}%.%uuid of player%} to player's x-coordinate
    11.                         set {coords.y.%{_num}%.%uuid of player%} to player's y-coordinate
    12.                         set {coords.z.%{_num}%.%uuid of player%} to player's z-coordinate
    13.                         send "&cSaved your coordinates to the ID » %arg-1%" to sender
    14.                     else:
    15.                         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
    16.                         stop
    17.                 else:
    18.                     send "&cThe number needs to be an integer!" to sender
    19.                     stop
    20.             else:
    21.                 send "&cSpecify a coordinate save value!" to sender
    22.                 stop
    23.         else:
    24.             send "&cYou cannot do this!" to sender
    25.             stop
     
    • Like Like x 1

Share This Page

Loading...