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.

Skript error help

Discussion in 'Requests' started by OzzyCraftt, Dec 3, 2021.

  1. OzzyCraftt

    OzzyCraftt Member

    Joined:
    Dec 2, 2021
    Messages:
    3
    Likes Received:
    0
    Code (Text):
    1. function direction(from: location, to: location) :: text:
    2.     set pitch of {_from} to 0.001
    3.     set {_behind} to true if (flatDistance({_from}, {_to})) - flatDistance(location 1 meter behind {_from} and {_to}) > 1/3
    4.     set {_infrontof} to true if (flatDistance({_from}, {_to})) - flatDistance(location 1 meter in front of {_from} and {_to}) > 1/3
    5.     set {_right} to true if (flatDistance({_from}, {_to})) - flatDistance(location 1 meter right {_from} and {_to}) > 1/3
    6.     set {_left} to true if (flatDistance({_from}, {_to})) - flatDistance(location 1 meter left {_from} and {_to}) > 1/3
    7.     return "⬊" if {_behind} and {_right} are true
    8.     return "⬋" if {_behind} and {_left} are true
    9.     return "⬈" if {_infrontof} and {_right} are true
    10.     return "⬉" if {_infrontof} and {_left} are true
    11.     if {_right} and {_left} are not set:
    12.         return "⬆" if {_infrontof} is true
    13.         return "⬇" if {_behind} is true
    14.     if {_infrontof} and {_behind} are not set:
    15.         return "<-" if {_left} is true
    16.         return "->" if {_right} is true
    17.     return "✔"
    18.  
    19. function flatDistance(from: location, to: location) :: number:
    20.     set y coordinate of {_from} to y coordinate of {_to}
    21.     return distance between {_from} and {_to}
    22.    
    23.    
    24. every tick:
    25.     set {_location} to location(0, 0, 0, world "sehir")
    26.     loop all players in world "world":
    27.         set {_direction} to direction(location of loop-player and {_location})
    28.         set {_distance} to round(flatDistance(loop-player and {_location}))
    29.         send action bar "&a%{_direction}%&r %{_distance}% blok uzaklıkta" to loop-player
     

    Attached Files:

  2. KokoPlayzYT

    KokoPlayzYT Member

    Joined:
    Aug 6, 2021
    Messages:
    21
    Likes Received:
    1
    it means that all of the returning values are a Number not a Boolean, if you want to keep this as a number then the returning value couldn't get set to true. that's the best explain i can give. hope you understood
     

Share This Page

Loading...