#Cancel teleport if moving

1 messages · Page 1 of 1 (latest)

sinful glen
#

how i can do like "if player moving - stop, else all ok he can teleport" (set {location} to player's location and check from it doesn't work, i need the player to be able to move the camera)

        cancel event
        send actionbar "<blue><bold>3" to player
        wait 1 seconds
        send actionbar "<blue><bold>2" to player
        wait 1 seconds
        send actionbar "<blue><bold>1" to players
        wait 1 seconds

(all skript)
||```on right click:
if held item is unbreakable flint and steel named "<purple>Особый Предмет" with lore "<red><bold>Данный предмет был дан за преданность богу.":
if player is "DeltaGGYT":
if player is sneaking:
if {selectedWorld} is "world_nether":
set {selectedWorld} to "world"
send actionbar "<green>Точка телепортации изменена на Верхний Мир" to player
else if {selectedWorld} is "world":
set {selectedWorld} to "world_the_end"
send actionbar "<purple>Точка телепортации изменена на Энд" to player
else if {selectedWorld} is "world_the_end":
set {selectedWorld} to "world_nether"
send actionbar "<red>Точка телепортации изменена на Нижний Мир" to player
cancel event
else:
cancel event
set {zone} to player's location
send actionbar "<blue><bold>3" to player
wait 1 seconds
send actionbar "<blue><bold>2" to player
wait 1 seconds
send actionbar "<blue><bold>1" to players
wait 1 seconds

    if player's health is less than 5:
      send actionbar "<red><bold>Недостаточно здоровья для телепортации" to player
    else:
      subtract 5 from player's health
      
      if {selectedWorld} is "world":
        teleport player to location(371, 75, -68, {selectedWorld})
      else if {selectedWorld} is "world_nether":
        teleport player to location(51, 100, 8, {selectedWorld})
      else if {selectedWorld} is "world_the_end":
        teleport player to location(-112, 58, -15, {selectedWorld})

      apply potion of weakness of tier 1 to player for 10 seconds
      apply potion of slowness of tier 1 to player for 10 seconds
      apply potion of blindness of tier 1 to player for 3 seconds
      apply potion of hunger of tier 1 to player for 10 seconds
      
      send actionbar "<blue><bold>Вы успешно телепортировались." to player``` ||
knotty smelt
#

already told you how to do it yesterday

sinful glen
#

i don't need that

#

i need stop teleport only if player moving

knotty smelt
#

in any case i wont be feeding you code sorry mate

lucid bolt
#

well set location of the player when he tping than check if the loc is the same as before

knotty smelt
#

ill just repeat what i said yesterday

#

set variable to player's location
start a loop
if player's location didnt change continue loop for as long as you need
if it changed stop code at cancel tp
else teleport player

sinful glen
knotty smelt
#

if you dont wanna figure it out yourself just copy some tpa code from spigot

#

so check for their x,y,z coord

sinful glen
#

it's like
if player nothing do - it teleport
if player do 180 teleport canceled

sinful glen
knotty smelt
#

maybe