#Cancel A Spawn Teleport

1 messages · Page 1 of 1 (latest)

warm ember
#

Hi, I'm looking to make a spawn teleportation cancel, but I can't seem to figure out how. Please help me if u can!

    trigger:
        set {spawn::%player%} to 4
        send title "&f☁ <##6AB6FB>&lꜱᴘᴀᴡɴ &f☁" with subtitle "&fᴛᴇʟᴇᴘᴏʀᴛɪɴɢ ᴛᴏ ꜱᴘᴀᴡɴ ɪɴ <##6AB6FB>&n5 ꜱᴇᴄᴏɴᴅꜱ." to player
        play sound "ui.button.click" with volume 0.5 with pitch 0.75 to player
        while {spawn::%player%} is not 0:
            wait a second
            send title "&f☁ <##6AB6FB>&lꜱᴘᴀᴡɴ &f☁" with subtitle "&fᴛᴇʟᴇᴘᴏʀᴛɪɴɢ ᴛᴏ ꜱᴘᴀᴡɴ ɪɴ <##6AB6FB>&n%{spawn::%player%}% ꜱᴇᴄᴏɴᴅꜱ." to player
            remove 1 from {spawn::%player%}
            play sound "ui.button.click" with volume 0.5 with pitch 0.75 to player
        {spawn::%player%} is 0
        wait 1 second
        teleport player to {spawn}
        delete {spawn::%player%}
        send title "&f☁ <##6AB6FB>&lꜱᴘᴀᴡɴ &f☁" with subtitle "&fʏᴏᴜ ʜᴀᴠᴇ ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ᴛᴇʟᴇᴘᴏʀᴛᴇᴅ ᴛᴏ <##6AB6FB>&nꜱᴘᴀᴡɴ." to player for 0.50 seconds
        play sound "entity.enderman.teleport" with volume 0.7 with pitch 0.75 to player

on quit:
    delete {spawn::%player%}```
#

The Spawn skript works fine, all I need is if a player starts moving using WSAD (not with mouse) that the teleportation get's canceled

wintry steppe
warm ember
#

How could I make a seperate cancel with the xyz coords?

#

I tried this, but it didn't work

    if {Spawn::%player%} is set:
        delete {Spawn::%player%}
        send title "&c&lERROR" with subtitle "&7TELEPORT CANCELED!" to player```
wintry steppe
#

well when executing the command i'd save the players location to a variable, then in a move event check if the location is still the same if it isnt it should cancel

warm ember
#

Sorry to ask, but could u do it for me? Cuz I have 0 clue how to do that

wintry steppe
#
    trigger:
        set {x} to player's location

on any move:
    if player's location = {x}:
        teleport player to location(x,y,z, in world(world))
    else:
        send "You moved!"``` this is the code i got. you will have to implement that to your code
#

no idea if it works

manic current
#

no

#

dont do that

#

so inefficient

#

just use a local variable

#
loop 10 times:
  wait 10 ticks
  if distance between player's location and {_original} > x:
    stop```
warm ember
manic current
#

By putting something like that in it