function e(player) {
const tags = player.getTags().map(tag => tag.startsWith("HOME:"))
let tp = new ActionFormData()
.title(`Teleport`)
.body(`Select your 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(`Home: ${home}\n${x} ${y} ${z}`)
}
tp.show(player).then(result => {
if (result.canceled)
return
})
}
#How to map out player tags in Actionformdata as a button
1 messages · Page 1 of 1 (latest)
Change .map() to .filter()