#how do i detect the direction a player is looking at

1 messages · Page 1 of 1 (latest)

severe quiver
#

you can check if the player's yaw is between 2 numbers

south oriole
tardy citrus
#

guess

south oriole
#

if player's yaw

#

im sorry

severe quiver
#

by using the yaw expression

south oriole
#

ill go shut up

tardy citrus
#
x < b```
south oriole
#

😭

severe quiver
#

just a simple player's yaw is between x and y is enough

#

its gonna work

south oriole
#

will it integrate the way minecraft's yaw system

#

or no

tardy citrus
#

+270 degrees = -90 degrees

#

its just using the one with smaller magnitude

south oriole
#

i can't tell what I did wrong

tardy citrus
#

so as soon as you pass half way itll be negative

#

one condition per line

south oriole
tardy citrus
#

nope, but google probably does

south oriole
#

im having some problem with my if statement..

#

essentially, it isn't detecting player yaw properly for some reason

tardy citrus
south oriole
#

if player's yaw is between 135 and 180:
wait 1 tick
make player run command "//rotate -90" as op
else if player's yaw is between -135 and -180:
send "This should be working?"
wait 4 ticks
make player run command "//rotate -90" as op

south oriole
#

they apply the same way in normal programming right

#

but simply it is not triggering between thowse two values

#

ive tried swapping them, etc and no difference is being made

tardy citrus
#
  1. code blocks
south oriole
#

code blocks?

tardy citrus
tardy citrus
south oriole
#

lemme see rq

tardy citrus
#

copy and paste

south oriole
#
    if player's yaw is between 135 and 180:
        wait 1 tick
        make player run command "//rotate -90" as op
    else if player's yaw is between -135 and -180:
        send "hi"
        wait 4 ticks
        make player run command "//rotate -90" as op
    if player's yaw is between 45 and 135:
        make player run command "//rotate 180" as op
    if player's yaw is between -45 and 45:
        make player run command "//rotate 90" as op```
tardy citrus
#

and debugging would proably help

south oriole
#

it doesnt send the hi msg nor rotate

#

I can send a quick video if u want

tardy citrus
#

then that condition didnt pass

#

add a part where you broadcast the yaw

south oriole
#

exactly, but is there a reason or something wrong with my condition

#

because I know for a fact im triggering it between -135 and -180

tardy citrus
#

if theres no syntax errors not likely

tardy citrus
tardy citrus
#

before the conditions

south oriole
#

you're right

#

you're a life save

south oriole
#

like

#

on block place

#

send "hi"

#

cancel block place

tardy citrus
#

yeah

#

thats just a simple cancel event, you can always readthedocs if you want to know how something is done

south oriole
#

like lets say i throw a snowball and hit hits block xyz, how do I paste a schematic from location xyz

tardy citrus
#

skbee structures

south oriole
tardy citrus
#

yup

#

you can google "skript docs" and "skbee wiki"

#

for docs don't use the offical ones by SkriptLang, they dont have addon stuff. use skripthub or skunity

south oriole
#

i see

#

I dont seem to find anything regarding schematic, or worldedit positiosn

#

anything you can say to help guide me

south oriole
#

anyone know how to paste a schematic from certain coords? like if i have cords xyz how do I paste it at those cords

tardy citrus
#

skbee structures