#Why does it show 0

1 messages · Page 1 of 1 (latest)

tight ginkgo
#

the response of my dropdown is converted to a 0 instead of the grade above

balmy zinc
tight ginkgo
#

to know which line which displays what is on the image is

                    \n§l§dGrade: §r§l${dislpayranks} 
#
                    const dislpayranks = getDisplayRanks(player)
#
    function Rank() {
        system.run(() => {
        const rank = getRanks(player)
        const CosmetiqueRank = new ModalFormData()
        CosmetiqueRank.dropdown(`Voici la liste de vos rank.`, rank)
        CosmetiqueRank.show(player).then(r => {
            const displayrank = r.formValues[0];
            player.runCommand(`tag @s remove displayrank:`)
            player.runCommand(`tag @s remove displayrank:`)
            player.runCommand(`tag @s remove "displayrank:§l§5Père Noel"`)

            player.runCommand(`tag @s add "displayrank:${displayrank}"`)
        })
    })
#

here is the grade I want to display

tight ginkgo
grim garden
#

The formValue of a dropdown is the index of your selection
if you select the first option of it it'll be 0

tight ginkgo
#

yes I just understood it but how to translate the 0 by my rank

balmy zinc
tight ginkgo
#

Thanks you

#

I found another solution but much less optimized

balmy zinc
tight ginkgo
#

could you give me some examples of generators?

balmy zinc
#

I have one here posted

#

you can just snag it from the repo

#

it has a custom form builder for ActionForm, MessageForm, and ModalForm. Also it has a custom builder for ChestGUI

#

which uses a resouce pack to render

#

also it adds the ability to disable buttons

tight ginkgo
#

ok thank you this will definitely help me a lot

tight ginkgo
balmy zinc