#name with space
1 messages · Page 1 of 1 (latest)
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
please tell me Tag format
player.addTag(HOME:${r.formValues[0]}: ${Object.values(player.location).map(Math.floor).join(" ")})
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?
and the teleport part?
no need to change maybe...
It needs
sorry it needed.
wait a minute..
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...
It was not
What error?
It did not teleport and the message did not appear
Is this worked?
show code
...
This is the tag format right?
(/tag @s add) "HOME:test name: 0 0 0"