How to teleport player properly

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

Status
Not open for further replies.

FFmax33

Member
Sep 1, 2020
2
0
0
24
Im trying to make a skript that when you right click with a certain item you teleport up 10 blocks, however my current code doesn't take into account your direction. Here is my current code:
Code:
rightclick with feather:
    if name of tool of player is "Booster":
        set {UniVari} to block 10 above player
        teleport player to {UniVari}
I have also tried
Code:
make console execute "/execute as %player% run tp ~ ~10 ~"
but that tp's you to 10 blocks above consoles location, not players.
I want this to work without needing essentials.tp or minecraft.command.tp perms
edit: Doesn't save velocity either (I want it to work with elytra as a way to contiuosly fly close to the ground)
edit2: MC teleport DOES do these thing but I don't know how to make an item run a command as you without you having perms without using execute
 
Last edited:
The teleport function works like this:
Code:
teleport player to location(x, y, z, world "world")

If you want to change their Y position by 10, set a local variable to their current Y position and add 10 to it.
 
The teleport function works like this:
Code:
teleport player to location(x, y, z, world "world")

If you want to change their Y position by 10, set a local variable to their current Y position and add 10 to it.
The problem isn't changing their Y position, it is doing that and keeping the players direction and momentum intact
 
The problem isn't changing their Y position, it is doing that and keeping the players direction and momentum intact

Then you should use the push effect. You can tweak it until you get something you're comfortable with (As far as I have tested, this does keep your momentum intact).
Code:
push the player upwards at speed 4
 
Status
Not open for further replies.