Someone gave me a ready-made form, I would like it to go from looking like this:
try {
if (!player.hasTag("admin") && item.typeId == "minecraft:stick") {
exDef.OnFormOne.show(player).then(
(result) => {
if (result.selection == 0) {
exDef.OnFormTwo.show(player).then(
(result) => {
if (result.selection == 0) {
player.runCommandAsync('say Triggered One, form1')
}
if (result.selection == 1) {
player.runCommandAsync('say Triggered Two, form 1')
}
}
);
player.runCommandAsync('say Triggered One, form 2')
}
if (result.selection == 1) {
player.runCommandAsync('say Triggered Two, form 2')
}
}
);
}```
I would like the commands that are executed when a button is touched to look like this
```js
function battle(player) {
new ModalFormData()
.title('§3§lBattle Pass')
.slider("Claim Your Tier! ", 1, 100, 1)
.show(player).then((r) => {
if (r.formValues[0] === 0) {
player.runCommandAsync('say test');
}
});
} ```
Here is my code