Cancel Teleportation with Movement

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Deegz

Member
May 14, 2023
3
1
3
23
Hey there. I'm quite confused on how to cancel the teleportation when someone moves..
Here's the code.

Code:
command testtp:
    aliases: tt, ttp
    trigger:
        wait 0.25 seconds
        console command "effect give %player% blindness 3 200"
        console command "effect give %player% slowness 3 10"             
        play sound "ui.button.click" with volume 1 with pitch 1 to player
        send title "{@prefix1}"
        send subtitle "test"
        wait 0.75 seconds
        play sound "ui.button.click" with volume 0.5 with pitch 1 to player
        send title "{@prefix1}"
        send subtitle "test."
        wait 0.75 seconds
        play sound "ui.button.click" with volume 0.5 with pitch 1 to player
        send title "{@prefix1}"
        send subtitle "test.."
        wait 0.75 seconds
        play sound "ui.button.click" with volume 0.5 with pitch 1 to player
        send title "{@prefix1}"
        send subtitle "test..."     
        teleport player to {test}
        send "{@prefix} &fYou have been teleported to &etest&f." to player
        play sound "minecraft:entity.experience_orb.pickup" to player
 
Hey there. I'm quite confused on how to cancel the teleportation when someone moves..
Here's the code.

Code:
command testtp:
    aliases: tt, ttp
    trigger:
        wait 0.25 seconds
        console command "effect give %player% blindness 3 200"
        console command "effect give %player% slowness 3 10"            
        play sound "ui.button.click" with volume 1 with pitch 1 to player
        send title "{@prefix1}"
        send subtitle "test"
        wait 0.75 seconds
        play sound "ui.button.click" with volume 0.5 with pitch 1 to player
        send title "{@prefix1}"
        send subtitle "test."
        wait 0.75 seconds
        play sound "ui.button.click" with volume 0.5 with pitch 1 to player
        send title "{@prefix1}"
        send subtitle "test.."
        wait 0.75 seconds
        play sound "ui.button.click" with volume 0.5 with pitch 1 to player
        send title "{@prefix1}"
        send subtitle "test..."    
        teleport player to {test}
        send "{@prefix} &fYou have been teleported to &etest&f." to player
        play sound "minecraft:entity.experience_orb.pickup" to player
Save the player's location when running the command, and check before teleporting if the location of the player is still the same.