#Lock on tp
1 messages · Page 1 of 1 (latest)
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
idk how to tho
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.
Any warp code?
@abstract rapids you want to stop the teleportation when the player move or hit by another player right?
yea
Use this the check if the player moving
const isMoving = player.getVelocity().x != 0 || player.getVelocity().y != 0 || player.getVelocity().z != 0;```
where do I put it?
You put it in your script.
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
kk
Ok this should have fixed a api mismatch I think see what error shows on this
There are 9 errors in this [code](#1176681758184448030 message):
[36mexample.js[0m:[33m10[0m:[33m77[0m - [31merror[0m[30m TS2554: [0mExpected 0 arguments, but got 1.
[7m10[0m if (data.itemStack.typeId == "minecraft:compass") system.run(() => main(player));
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mexample.js[0m:[33m22[0m:[33m41[0m - [31merror[0m[30m TS2554: [0mExpected 0 arguments, but got 1.
[7m22[0m if (r.selection == 0) Warps(player);
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mexample.js[0m:[33m23[0m:[33m35[0m - [31merror[0m[30m TS2304: [0mCannot find name 'DiscordKit'.
[7m23[0m if (r.selection == 1) DiscordKit(player);
[7m [0m [31m ~~~~~~~~~~[0m
``````ansi
[36mexample.js[0m:[33m24[0m:[33m35[0m - [31merror[0m[30m TS2304: [0mCannot find name 'moneyTransfer'.
[7m24[0m if (r.selection == 2) moneyTransfer(player);
[7m [0m [31m ~~~~~~~~~~~~~[0m
``````ansi
[36mexample.js[0m:[33m25[0m:[33m35[0m - [31merror[0m[30m TS2304: [0mCannot find name 'Credits'.
[7m25[0m if (r.selection == 3) Credits(player);
[7m [0m [31m ~~~~~~~[0m
``````ansi
[36mexample.js[0m:[33m44[0m:[33m21[0m - [31merror[0m[30m TS18048: [0m'r.selection' is possibly 'undefined'.
[7m44[0m if (r.selection < 4) {
[7m [0m [31m ~~~~~~~~~~~[0m
``````ansi
[36mexample.js[0m:[33m45[0m:[33m61[0m - [31merror[0m[30m TS2538: [0mType 'undefined' cannot be used as an index type.
[7m45[0m startTeleport(player, teleportLocations[r.selection]);
[7m [0m [31m ~~~~~~~~~~~[0m
``````ansi
[36mexample.js[0m:[33m47[0m:[33m26[0m - [31merror[0m[30m TS2554: [0mExpected 0 arguments, but got 1.
[7m47[0m main(player);
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mexample.js[0m:[33m88[0m:[33m32[0m - [31merror[0m[30m TS2339: [0mProperty 'getPlayerByName' does not exist on type 'World'.
[7m88[0m let player = world.getPlayerByName(playerName);
[7m [0m [31m ~~~~~~~~~~~~~~~[0m
k
Changed to correct.. .getAllPlayers
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[]'.
Just give a try
k
I disabled movement with input permission lol so it really disables you haha
yea I see
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
ok so issue the player cant move to cancel it their like stuck and when they get hit it they still tp
k
adding a countdown timer in actionbar for you
k
almost done
bro, it works good i think
enjoy, it should handle a few messages depending on whats happened you can always adjust
ahh yes it works tysm!!
ENJOY!
hey do you have time to help me with something else?
@crisp lintel srry for the ping but could you possibly help?
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
thats exactly what I am in and I already promised the person so I have to complete it
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
well and the Discord Reedem
🤔
How it be for me 2 lol
?
theres a part in the code that has the discord redeem its right below the function Warps
What do y'all do for updates after the sales?
we do it free off charge
if it's a change in api
if it's a improved version they will have to pay for that one
Hmm i want to know more about it Enchant
@rancid yarrow