#is there a way i can detect button selection regardless of the order?
1 messages · Page 1 of 1 (latest)
function trai(player) {
const actions = []
const trailsa = new ActionFormData()
.title("§eTrails")
.body("All trails bought will appear here.");
if (trails.trail0 === 1) {
trailsa.button("§cFire Trail");
actions.push(() => {
player.sendMessage("§dFire Trail was equipped.");
player.playSound("armor.equip_diamond")
trailequip = 1;
})
}
if (trails.trail1 === 1) {
trailsa.button("§gTotem Trail");
actions.push(() => {
player.sendMessage("§aTotem Trail was equipped.");
trailequip = 2;
})
}
trailsa.show(player).then(data => {
if (data.canceled) return;
actions[data.selection]();
});
}