Can't divide x position by 30

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

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

Universz

Member
Oct 25, 2019
3
0
1
chester hill
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:
command /position:
 trigger:
  set {xposition} to "%x position of player% / 30"
  set {zposition} to "%z position of player% / 30"
  send "{xposition}" to player
  send "{zposition}" to player
 
You have to use '%' to get the value of a variable in the string. Similar how you did when setting the variable.

Ex.

Code:
"%x position of player% / 3" = "10 / 3"
"%x position of player / 3%" =  "3.33"

"{xposition}" = "{xposition}"
"%{xposition}%" = "3.33"
 
Thank you! Now I want to make the link clickable but it doesn't work with variables and json I think

Code:
 message "<link:http://google.com/maps/place/%{zposition}%+%{xposition}%/>"
Output =  <link:http://google.com/maps/place/number+number/>

message "<link:http://google.com/maps/place/"
Output = http://google.com/maps/place/"
 
Status
Not open for further replies.