# Skript error help

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

1. ### OzzyCraftt Member

Joined:
Dec 2, 2021
Messages:
3
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

File size:
307.6 KB
Views:
52
#1
2. ### KokoPlayzYT Member

Joined:
Aug 6, 2021
Messages:
21
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

#2