#how do i fix this so it wont teleport through walls

1 messages · Page 1 of 1 (latest)

vast cosmos
#

im not sure why you need vectors for this.

#

why not use player's target block?

#

you can then go backwards 1/2 block as well so they dont go into walls

stiff talon
#

ok

#

so how would that work?

#

i sent the wrong skript 😭

#
    if name of player's held item is "&5&lᴇɴᴅᴇʀ'ꜱ ᴋᴀᴛᴀɴᴀ":
        if cooldown of player's tool for player is 0 seconds:
            set item cooldown of netherite sword named "&5&lᴇɴᴅᴇʀ'ꜱ ᴋᴀᴛᴀɴᴀ" for player to 60 seconds
            set {_loc} to location 5 blocks infront of player
            loop 3 times:
                if block at {_loc} is solid:
                    add 1 to y-coordinate of {_loc}
                else if block above {_loc} is solid:
                    add 1 to y-coordinate of {_loc}
                else:
                    stop loop
            if block below {_loc} is not solid:
                loop 3 times:
                    remove 1 from y-coordinate of {_loc}
                    if block below {_loc} is solid:
                        stop loop
            teleport player to {_loc}
            play sound "minecraft:entity.enderman.teleport" with volume 1 and pitch 1 at player``` this is the origional one
#

0 errors and it jst tp's me through the blocks infront of me

vast cosmos
#

You can remove the vector from players target block i guess

#

But you do knpw that cooldown affects all netherite swords, right? Not just the one with the custom name