I already completed it, i just want to make it cannot be claimed again after player already claimed.
forceShow(player, form).then(result => {
const t = result.formValues[0];
if (code[t]) {
player.runCommandAsync(`give @s ${code[t]}`)
player.runCommandAsync("playsound random.toast @s")
player.addTag(`${code[t]}`)
} else {
player.tell("§cWrong/Invalid code!")
player.runCommandAsync("playsound note.bass @s")
}
if (player.hasTag(code[t]) == t) {
player.tell("§cAlready redeemed!")
player.runCommandAsync("playsound note.bass @s")
}
})
I tried this, it don't work