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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Locations, .5

Discussion in 'Skript' started by Marsbar, May 7, 2020.

Tags:
Thread Status:
Not open for further replies.
  1. Marsbar

    Marsbar Active Member

    Joined:
    Mar 31, 2019
    Messages:
    131
    Likes Received:
    4
    Hi im having an issue with this cell skript im making. When you claim with the stick, it set coordinates.
    The issue is that it changes the coordinate depending on the server. It claims wrongly (Is that a word?). Sometimes it adds 1 more or 1 less on the z or x coordinate.
    Code (Text):
    1. on click:
    2.     player's tool is blaze rod named colored "&c&lCeller":
    3.         if {cells.claiming.%player%} is not true:
    4.             set {cells.claiming12.%player%} to location of targeted block
    5.             set {cells.claiming.%player%} to true
    6.             send "&6&lClaiming: &6Position 1 set: (%x coordinate of {cells.claiming12.%player%}%, %y coordinate of {cells.claiming12.%player%}%, %z coordinate of {cells.claiming12.%player%}%)"
    7.             cancel event
    8.             stop
    9.         else if {cells.claiming.%player%} is true:
    10.             set {cells.claiming22.%player%} to location of targeted block
    11.             set {cells.claiming.%player%} to false
    12.         if y coordinate of {cells.claiming12.%player%} is bigger than y coordinate of {cells.claiming22.%player%}:
    13.             set {cells.claiming2.%player%} to {cells.claiming12.%player%}
    14.             set {cells.claiming1.%player%} to {cells.claiming22.%player%}
    15.         else:
    16.             set {cells.claiming2.%player%} to {cells.claiming22.%player%}
    17.             set {cells.claiming1.%player%} to {cells.claiming12.%player%}
    18.         if y coordinate of {cells.claiming22.%player%} is equal to y coordinate of {cells.claiming12.%player%}:
    19.             set {cells.claiming1.%player%} to {cells.claiming12.%player%}
    20.             set {cells.claiming2.%player%} to {cells.claiming22.%player%}
    21.         send "&6&lClaiming &a&l✔ &6Positions: (%x coordinate of {cells.claiming1.%player%}%, %y coordinate of {cells.claiming1.%player%}%, %z coordinate of {cells.claiming1.%player%}%) (%x coordinate of {cells.claiming2.%player%}%, %y coordinate of {cells.claiming2.%player%}%, %z coordinate of {cells.claiming2.%player%}%)"
    22.         cancel event
    23.  
    Thats when you claim the coordinates.
    Code (Text):
    1.             set {_1} to "%x coordinate of {cells.claiming1.%player%}%"
    2.             set {_2} to "%y coordinate of {cells.claiming1.%player%}%"
    3.             set {_3} to "%z coordinate of {cells.claiming1.%player%}%"
    4.             set {_4} to "%x coordinate of {cells.claiming2.%player%}%"
    5.             set {_5} to "%y coordinate of {cells.claiming2.%player%}%"
    6.             set {_6} to "%z coordinate of {cells.claiming2.%player%}%"
    7.             loop 6 times:
    8.                 replace all ",5" in {_%loop-number%} with ""
    9.                 replace all ".5" in {_%loop-number%} with ""
    10.                 set {_%loop-number%} to {_%loop-number%} parsed as an integer
    11.             wait 1 tick
    12.             remove 1 from {_3}
    13.             remove 1 from {_6}
    14.             set {_p1} to "%({_1})%,%({_2})%,%({_3})%"
    15.             set {_p2} to "%({_4})%,%{_5}%,%({_6})%"
    16.             execute player command "//pos1 %{_p1}%"
    17.             execute player command "//pos2 %{_p2}%"
    18.             wait 1 tick
    19.             clear {cell.%arg-2%.owner}
    20.             set {cell.%arg-2%.world} to world of targeted block
    21.             clear {cell.%arg-2%.Members::*}
    22.             set {cell.%arg-2%.signcoords} to targeted block
    23.             set {cell.%arg-2%} to arg-2
    24.             set {cell.%arg-2%.l1} to {cells.claiming1.%player%}
    25.             set {cell.%arg-2%.l2} to {cells.claiming2.%player%}
    26.             clear {cells.claiming1.%player%}
    27.             clear {cells.claiming2.%player%}
    28.             add arg-2 to {cells.all::*}
    29.             execute player command "/rg d %arg-2%"
    30.             wait 2 ticks
    31.             execute player command "//sel"
    I can't understand why it changes coordinates depending on the server.
    And is it possible to get the coordinate of a block without the 0.5?
     
Thread Status:
Not open for further replies.

Share This Page

Loading...