#(yriokiri) item description issue

26 messages · Page 1 of 1 (latest)

tepid apex
#

i was making a description for an item in a GUI

  • '<script[generator_value].data_key[stats.bonus].get[<player.flag[gen_up_bonus]>]>%'

my issue is that when player start the 'flag gen_up_bonus' is '0' but the index of a list start at '1'. How can i say there that if gen_up_bonus is '0' it write '0' instead of the first value of the list?

subtle urchinBOT
#

(yriokiri) item description issue

subtle urchinBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

tepid apex
pseudo ravine
#

pls use the paste site

#

!paste

vocal coveBOT
tepid apex
#

oh sorry forgot

#

put them both in the same page but they are in separate files for organization

worn bolt
#

You can just reformat your data script

#
    type: data
    stats:
      bonus:
        0: 0
        1: 12
        2: 15

#item container
stats:
    type: item
    material: paper
    display name: <&6><&l>Passive Generator
    lore:
    - ''
    - '<&7><&l>Stats'
    - ' <&7>・Bonus drop: <&e><script[generator_value].data_key[stats.bonus.<player.flag[gen_up_bonus]||0>]>%'```
#

to use a map instead of getting a value from a list

#

then read that value from the map

#

stats.bonus.0 will return 0 etc

#

<player.flag[gen_up_bonus]||0> ==> ||0 is a fallback so the tag doesn't error and returns 0 if they don't have the flag at all

tepid apex
worn bolt
#

You're welcome!