As the title suggests, my teleport code is not working. There's no errors, it's just teleporting me in the wrong direction.
once i right click on a nether star, it runs this code:
so if anyone knows how to fix this, please let me know!
once i right click on a nether star, it runs this code:
Code:
(other stuff)
set {_posX} to player's x-position
set {_posY} to player's y-position
set {_posZ} to player's z-position
if player's facing is north:
set {warp} to location ({_posX}, ({_posY} + 1), ({_posZ} - 10))
set yaw of {warp} to 180
teleport player to {warp}
play sound "entity.enderman.teleport" at volume 3 to entities in radius 20 of player
if player's facing is east:
set {warp} to location (({_posX} + 10), ({_posY} + 1), {_posZ})
set yaw of {warp} to -90
teleport player to {warp}
play sound "entity.enderman.teleport" at volume 3 to entities in radius 20 of player
if player's facing is south:
set {warp} to location ({_posX}, ({_posY} + 1), ({_posZ} + 10))
set yaw of {warp} to 0
teleport player to {warp}
play sound "entity.enderman.teleport" at volume 3 to entities in radius 20 of player
if player's facing is west:
set {warp} to location (({_posX} - 10), ({_posY} + 1), {_posZ})
set yaw of {warp} to 90
teleport player to {warp}
play sound "entity.enderman.teleport" at volume 3 to entities in radius 20 of player
if player's pitch is -90:
set {warp} to location (({_posX}), ({_posY} + 9), {_posZ})
set pitch of {warp} to -90
teleport player to {warp}
play sound "entity.enderman.teleport" at volume 3 to entities in radius 20 of player
if player's pitch is 90:
set {warp} to location (({_posX}), ({_posY} - 9), {_posZ})
set pitch of {warp} to 90
teleport player to {warp}
play sound "entity.enderman.teleport" at volume 3 to entities in radius 20 of player
if 20 is less than player's yaw:
if player's yaw is less than 60:
set {warp} to location (({_posX} - 8), ({_posY} + 1), ({_posZ} + 8))
set yaw of {warp} to 45
teleport player to {warp}
stop
if -160 is less than player's yaw:
if player's yaw is more than -100:
set {warp} to location (({_posX} + 8), ({_posY} + 1), ({_posZ} - 8))
set yaw of {warp} to -145
teleport player to {warp}
stop
if player's yaw is greater than 120:
if player's yaw is less than 160:
set {warp} to location (({_posX}) - 8, ({_posY}), ({_posZ}) - 8)
set yaw of {warp} to 145
teleport player to {warp}
stop
if -60 is less than player's yaw:
if player's yaw is greater than -20:
set {warp} to location (({_posX} + 8), ({_posY}), ({_posZ} + 8))
set yaw of {warp} to -45
teleport player to {warp}
stop