#Lock on tp

1 messages · Page 1 of 1 (latest)

abstract rapids
#

anyone know how to make it so when a player is trying to warp they get locked in place and when they get hit by another player the tp cancels?

crisp lintel
#

Just don't let them warp with condition, and then make a timer before teleporting and if the player gets hit before it hits a end value then stop the timer clearRun

abstract rapids
#

idk how to tho

crisp lintel
#

Send code

#

@abstract rapids

river condor
#

Have a look at Jayly’s repository and there’s a file called “is-moving.js.” This exports a function you can use to determine if a player is moving and you can use that to cancel a teleport countdown, etc. (e.g. if(isMoving(player)) {…). This would work if the player moves or is moved by another player’s hit.

abstract rapids
vivid lynx
#

@abstract rapids you want to stop the teleportation when the player move or hit by another player right?

abstract rapids
#

yea

vivid lynx
#

Use this the check if the player moving

const isMoving = player.getVelocity().x != 0 || player.getVelocity().y != 0 || player.getVelocity().z != 0;```
abstract rapids
#

where do I put it?

rustic timber
#

You put it in your script.

crisp lintel
#

Might be totally broken

#

I can't test or make fixes as I'm not on my pc

abstract rapids
#

oh

#

ill test rq

crisp lintel
#

But test I guess

#

Yeh

#

Yeah it's broken I already see an issue

#

@abstract rapids don't use yet let me make a fux

#

Fix

abstract rapids
#

kk

crisp lintel
#

Ok this should have fixed a api mismatch I think see what error shows on this

lean hemlockBOT
#
Debug Result

There are 9 errors in this [code](#1176681758184448030 message):

example.js:10:77 - error TS2554: Expected 0 arguments, but got 1.

10     if (data.itemStack.typeId == "minecraft:compass") system.run(() => main(player));
                                                                               ~~~~~~

``````ansi
example.js:22:41 - error TS2554: Expected 0 arguments, but got 1.

22             if (r.selection == 0) Warps(player);
                                           ~~~~~~

``````ansi
example.js:23:35 - error TS2304: Cannot find name 'DiscordKit'.

23             if (r.selection == 1) DiscordKit(player);
                                     ~~~~~~~~~~

``````ansi
example.js:24:35 - error TS2304: Cannot find name 'moneyTransfer'.

24             if (r.selection == 2) moneyTransfer(player);
                                     ~~~~~~~~~~~~~

``````ansi
example.js:25:35 - error TS2304: Cannot find name 'Credits'.

25             if (r.selection == 3) Credits(player);
                                     ~~~~~~~

``````ansi
example.js:44:21 - error TS18048: 'r.selection' is possibly 'undefined'.

44                 if (r.selection < 4) {
                       ~~~~~~~~~~~

``````ansi
example.js:45:61 - error TS2538: Type 'undefined' cannot be used as an index type.

45                     startTeleport(player, teleportLocations[r.selection]);
                                                               ~~~~~~~~~~~

``````ansi
example.js:47:26 - error TS2554: Expected 0 arguments, but got 1.

47                     main(player);
                            ~~~~~~

``````ansi
example.js:88:32 - error TS2339: Property 'getPlayerByName' does not exist on type 'World'.

88             let player = world.getPlayerByName(playerName);
                                  ~~~~~~~~~~~~~~~

crisp lintel
#

Oof lol yup

#

Let me fix

abstract rapids
#

k

crisp lintel
lean hemlockBOT
#
Debug Result

There are 12 errors in this [code](#1176681758184448030 message):

example-1.js(10,6): Expected 0 arguments, but got 1.
example-1.js(22,6): Expected 0 arguments, but got 1.
example-1.js(23,10): Cannot find name 'DiscordKit'.
example-1.js(24,13): Cannot find name 'moneyTransfer'.
example-1.js(25,7): Cannot find name 'Credits'.
example-1.js(44,11): 'r.selection' is possibly 'undefined'.
example-1.js(45,11): Type 'undefined' cannot be used as an index type.
example-1.js(47,6): Expected 0 arguments, but got 1.
example-1.js(88,10): Expected 0 arguments, but got 1.
example-1.js(90,11): Property 'getVelocity' does not exist on type 'Player[]'.
example-1.js(90,11): Property 'getVelocity' does not exist on type 'Player[]'.
example-1.js(90,11): Property 'getVelocity' does not exist on type 'Player[]'.
crisp lintel
#

Just give a try

abstract rapids
#

k

crisp lintel
#

I disabled movement with input permission lol so it really disables you haha

abstract rapids
#

yea I see

crisp lintel
#

can remove the input permission thing and just check if player is moving to cancel teleport as well

#

so players can decided to leave or cancel

abstract rapids
#

ok so issue the player cant move to cancel it their like stuck and when they get hit it they still tp

crisp lintel
#

yup lol ill fix reall quck

#

quick

abstract rapids
#

k

crisp lintel
#

adding a countdown timer in actionbar for you

abstract rapids
#

k

crisp lintel
#

almost done

crisp lintel
abstract rapids
#

ahh yes it works tysm!!

crisp lintel
abstract rapids
#

hey do you have time to help me with something else?

crisp lintel
#

not really, im doing my own stuff

#

whats up maybe someone else can help

abstract rapids
#

this wont work

#

I tried adding money transfer system and it didnt work

abstract rapids
#

@crisp lintel srry for the ping but could you possibly help?

crisp lintel
#

Money transfer is all you need help with?

#

Or your tryn to have everything done so you don't have to do it lol

#

@abstract rapids

digital surge
crisp lintel
#

Lol truth

digital surge
# crisp lintel Lol truth

and the crazy thing is that it's so good it's good enough to sell on Enchant for 9 dollars, 🙃 , I plan on after it making it alot better for the black firday sales

abstract rapids
digital surge
#

🤔

crisp lintel
abstract rapids
# crisp lintel ?

theres a part in the code that has the discord redeem its right below the function Warps

rustic timber
digital surge
#

if it's a change in api

#

if it's a improved version they will have to pay for that one

vivid lynx
digital surge