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.

Can't divide x position by 30

Discussion in 'Skript' started by Universz, Dec 6, 2019.

Thread Status:
Not open for further replies.
  1. Universz

    Universz Member

    Joined:
    Oct 25, 2019
    Messages:
    3
    Likes Received:
    0
    Hello, I have a server that is the Earth in Minecraft, that shows the coordinates if divided by 30, so I created a skript for this purpose. My code is below, except it is not working properly, it only comes up with:
    {xposition}
    {zposition}

    Code (Text):
    1. command /position:
    2.  trigger:
    3.   set {xposition} to "%x position of player% / 30"
    4.   set {zposition} to "%z position of player% / 30"
    5.   send "{xposition}" to player
    6.   send "{zposition}" to player
     
  2. Policiu

    Policiu Member

    Joined:
    Jan 28, 2017
    Messages:
    15
    Likes Received:
    0
    You have to use '%' to get the value of a variable in the string. Similar how you did when setting the variable.

    Ex.

    Code (Text):
    1. "%x position of player% / 3" = "10 / 3"
    2. "%x position of player / 3%" =  "3.33"
    3.  
    4. "{xposition}" = "{xposition}"
    5. "%{xposition}%" = "3.33"
     
  3. Universz

    Universz Member

    Joined:
    Oct 25, 2019
    Messages:
    3
    Likes Received:
    0
    Thank you! Now I want to make the link clickable but it doesn't work with variables and json I think

    Code (Text):
    1.  message "<link:http://google.com/maps/place/%{zposition}%+%{xposition}%/>"
    2. Output =  <link:http://google.com/maps/place/number+number/>
    3.  
    4. message "<link:http://google.com/maps/place/"
    5. Output = http://google.com/maps/place/"
     
  4. ZeyKra_

    ZeyKra_ Active Member

    Joined:
    Dec 12, 2019
    Messages:
    109
    Likes Received:
    2
Thread Status:
Not open for further replies.
Loading...