#name with space

1 messages · Page 1 of 1 (latest)

main matrix
#

please code

rigid night
#
function exgui6(player) {
const tags = player.getTags().filter(tag => tag.startsWith("HOME:"))
if (tags.length === 0) {
  const gui8 = new ActionFormData()
gui8.title("§lTeleportar Home")
gui8.body("Voce nao possui home para teleportar!")
gui8.button("§lCriar Home");
        gui8.show(player).then(result => {
if(result.selection === 0){
                exgui5(player);
            }
        })
  return;
}
  const tp = new ActionFormData()
    .title("§lTeleportar Home")
    .body("Selecione uma home:")

 for (const tag of tags) {
        const loc = tag.split(" ")
        const home = loc[0].split(":")[1]
        const x = loc[1]
        const y = loc[2]
        const z = loc[3]
        tp.button(`§l${home}\n§2${x} ${y} ${z}`)

    }
    tp.show(player).then(result => {
    
           const r = tags[result.selection].split(" ")
           const home = r[0].split(":")[1]
           const x = r[1]
           const y = r[2]
           const z = r[3]
           player.runCommandAsync(`tp @s ${x} ${y} ${z}`)
           player.sendMessage("§aSucesso ao se teleportar na home§f " + home)
           player.runCommandAsync(`playsound random.orb @s`)
       
    })
}
#

ok

main matrix
#

please tell me Tag format

rigid night
#

player.addTag(HOME:${r.formValues[0]}: ${Object.values(player.location).map(Math.floor).join(" ")})

main matrix
#
const loc = tag.split(":")
const home = loc[1]
const x = loc[2].split(" ")[1]
const y = loc[2].split(" ")[2]
const z = loc[2].split(" ")[3]

How about it?

rigid night
#

and the teleport part?

main matrix
#

no need to change maybe...

rigid night
#

It needs

main matrix
#
           const r = tags[result.selection].split("\n")
           const home = r[0]
           const x = r[1].split(" ")[0]
           const y = r[1].split(" ")[1]
           const z = r[1].split(" ")[2]
#

Maybe I should write a little more...

rigid night
#

It was not

main matrix
#

What error?

rigid night
#

It did not teleport and the message did not appear

main matrix
#

This is the tag format right?
(/tag @s add) "HOME:test name: 0 0 0"

rigid night
#

Yes

main matrix
#

TP

const r = tags[result.selection].split(":")
const home = r[1]
const x = r[2].split(" ")[1]
const y = r[2].split(" ")[2]
const z = r[2].split(" ")[3]
#

how about it?