#Showing form after first form got callback

1 messages · Page 1 of 1 (latest)

tawdry sky
#

@pseudo plinth can you help pls? You're the one, who can answer now and who helped me before

slate parcel
#

You didn't have .title() on Modal Form
I think's that's not the reason

tawdry sky
#

That's the reason?

#

K, I'll try to add this

#

Wait

#

First form works well

#

It didn't helped

coral wrenBOT
#
Debug Result

There are 8 errors in this [code](#1092026958101086258 message):

<repl>.js:2:35 - error TS2304: Cannot find name 'plrs'.

2   game.dropdown("Список игроков", plrs.map(plr => plr.name), 0)
                                    ~~~~
<repl>.js:4:13 - error TS2304: Cannot find name 'owner'.

4   game.show(owner).then((gameop) => {
              ~~~~~
<repl>.js:5:5 - error TS2741: Property 'canceled' is missing in type 'any[]' but required in type 'ModalFormResponse'.

5     gameop= gameop.formValues
      ~~~~~~

  @minecraft/server-ui.d.ts:47:22
    47             readonly canceled: boolean;
                            ~~~~~~~~
    'canceled' is declared here.
<repl>.js:6:9 - error TS2488: Type 'ModalFormResponse' must have a '[Symbol.iterator]()' method that returns an iterator.

6     let [ plr, mode ] = gameop
          ~~~~~~~~~~~~~
<repl>.js:7:11 - error TS2552: Cannot find name 'plrs'. Did you mean 'plr'?

7     plr = plrs[plr]
            ~~~~

  <repl>.js:6:11
    6     let [ plr, mode ] = gameop
                ~~~
    'plr' is declared here.
<repl>.js:10:9 - error TS2304: Cannot find name 'playerChange'.

10         playerChange(owner, plr)
           ~~~~~~~~~~~~
<repl>.js:10:22 - error TS2304: Cannot find name 'owner'.

10         playerChange(owner, plr)
                        ~~~~~
<repl>.js:15:6 - error TS1005: '}' expected.

15     }
        

  <repl>.js:4:37
    4   game.show(owner).then((gameop) => {
                                          ~
    The parser expected to find a '}' to match the '{' token here.

#
Debug Result

There are 16 errors in this [code](#1092026958101086258 message):

<repl>.js:4:34 - error TS2304: Cannot find name 'getScore'.

4   plrset.textField("Уровень", `${getScore(plr, "level")}`, `${getScore(plr, "level")}`)
                                   ~~~~~~~~
<repl>.js:4:63 - error TS2304: Cannot find name 'getScore'.

4   plrset.textField("Уровень", `${getScore(plr, "level")}`, `${getScore(plr, "level")}`)
                                                                ~~~~~~~~
<repl>.js:5:50 - error TS2304: Cannot find name 'getScore'.

5   plrset.slider("Опыт %%", 0, 100, 5, Math.floor(getScore(plr, "exp") / expmax * 100))
                                                   ~~~~~~~~
<repl>.js:5:73 - error TS2304: Cannot find name 'expmax'.

5   plrset.slider("Опыт %%", 0, 100, 5, Math.floor(getScore(plr, "exp") / expmax * 100))
                                                                          ~~~~~~
<repl>.js:6:33 - error TS2304: Cannot find name 'getScore'.

6   plrset.textField("Баланс", `${getScore(plr, "money")}`, `${getScore(plr, "money")}`)
                                  ~~~~~~~~
<repl>.js:6:62 - error TS2304: Cannot find name 'getScore'.

6   plrset.textField("Баланс", `${getScore(plr, "money")}`, `${getScore(plr, "money")}`)
                                                               ~~~~~~~~
<repl>.js:9:5 - error TS2741: Property 'canceled' is missing in type 'any[]' but required in type 'ModalFormResponse'.

9     setop = setop.formValues
      ~~~~~

  @minecraft/server-ui.d.ts:47:22
    47             readonly canceled: boolean;
                            ~~~~~~~~
    'canceled' is declared here.
<repl>.js:10:9 - error TS2488: Type 'ModalFormResponse' must have a '[Symbol.iterator]()' method that returns an iterator.

10     let [ setlevel, rawexp, setmoney, other ] = setop
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<repl>.js:11:5 - error TS2304: Cannot find name 'expmax'.

11     expmax = Math.floor(Math.pow(setlevel, 0.85)) * 5 + Math.floor(setlevel / 10) * 5 + Math.floor(setlevel / 50) * 10 + 15
       ~~~~~~
<repl>.js:12:44 - error TS2304: Cannot find name 'expmax'.

12     let setexp = Math.floor(rawexp / 100 * expmax)
                                              ~~~~~~
<repl>.js:13:5 - error TS2304: Cannot find name 'setScore'.

13     setScore(plr, 'level', setlevel)
       ~~~~~~~~
<repl>.js:14:5 - error TS2304: Cannot find name 'setScore'.

14     setScore(plr, 'exp', setexp)
       ~~~~~~~~
<repl>.js:15:5 - error TS2304: Cannot find name 'setScore'.

15     setScore(plr, 'expshow', setexp)
       ~~~~~~~~
<repl>.js:16:5 - error TS2304: Cannot find name 'setScore'.

16     setScore(plr, 'expmax', expmax)
       ~~~~~~~~
<repl>.js:16:29 - error TS2304: Cannot find name 'expmax'.

slate parcel
#
plrset.slider("Опыт %%", 0, 100, 5, Math.floor(getScore(plr, "exp") / expmax * 100))

What expmax defined?

#

Well, if it's not a number (like undefined), that will give syntax error

#

Yes, because that issue, the form break lol

tawdry sky
#

Console is clear

#

As my mind

slate parcel
#

Then what expmax?

tawdry sky
#

Lemme check

#

expmax was not declared before

#

Thx, i added let

#

But

#

If there was no errors

#

Then there's still error somewhere

#

I'll add some warns to check

#

It just doesn't shows the form