Skript error help

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

OzzyCraftt

Member
Dec 2, 2021
3
0
1
22
Code:
function direction(from: location, to: location) :: text:
    set pitch of {_from} to 0.001
    set {_behind} to true if (flatDistance({_from}, {_to})) - flatDistance(location 1 meter behind {_from} and {_to}) > 1/3
    set {_infrontof} to true if (flatDistance({_from}, {_to})) - flatDistance(location 1 meter in front of {_from} and {_to}) > 1/3
    set {_right} to true if (flatDistance({_from}, {_to})) - flatDistance(location 1 meter right {_from} and {_to}) > 1/3
    set {_left} to true if (flatDistance({_from}, {_to})) - flatDistance(location 1 meter left {_from} and {_to}) > 1/3
    return "⬊" if {_behind} and {_right} are true
    return "⬋" if {_behind} and {_left} are true
    return "⬈" if {_infrontof} and {_right} are true
    return "⬉" if {_infrontof} and {_left} are true
    if {_right} and {_left} are not set:
        return "⬆" if {_infrontof} is true
        return "⬇" if {_behind} is true
    if {_infrontof} and {_behind} are not set:
        return "<-" if {_left} is true
        return "->" if {_right} is true
    return "✔"

function flatDistance(from: location, to: location) :: number:
    set y coordinate of {_from} to y coordinate of {_to}
    return distance between {_from} and {_to}
    
    
every tick:
    set {_location} to location(0, 0, 0, world "sehir")
    loop all players in world "world":
        set {_direction} to direction(location of loop-player and {_location})
        set {_distance} to round(flatDistance(loop-player and {_location}))
        send action bar "&a%{_direction}%&r %{_distance}% blok uzaklıkta" to loop-player
 

Attachments

  • 2021-12-03_14.17.28.png
    2021-12-03_14.17.28.png
    307.6 KB · Views: 103
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