#issue with form

1 messages · Page 1 of 1 (latest)

split forum
#
    const form = new ActionFormData()
    form.button("back")
    form.button(`attack: ${world.scoreboard.getObjective('attack').getScore(entity.scoreboardIdentity)}`)
    form.button(`til next level: ${world.scoreboard.getObjective('attack_r').getScore(entity.scoreboardIdentity)}`)
    form.button(`total: ${world.scoreboard.getObjective('attack_xp').getScore(entity.scoreboardIdentity)}`)
    form.show(entity).then(data => {
        switch (data.selection) {
            case 0:
                form(entity)
                break;
        }
    })
}```
im having issues with this the rest works but if i click back it pulls an error
split forum
#

??

scenic wolfBOT
#
Debug Result

JavaScript/TypeScript code blocks not detected in [message](#1147193285778100224 message).
You can either send the script in code block highlighted in JS format:

​`​`​`js
world.sendMessage("Hello World");
​`​`​`

Or Send an attachment end in .js to debug the file.

candid trellis
#
import { ActionFormData } from "@minecraft/server-ui";

const attackguide = (entity) => {
    const form = new ActionFormData()
    form.button("back")
    form.button(`attack: ${world.scoreboard.getObjective('attack').getScore(entity.scoreboardIdentity)}`)
    form.button(`til next level: ${world.scoreboard.getObjective('attack_r').getScore(entity.scoreboardIdentity)}`)
    form.button(`total: ${world.scoreboard.getObjective('attack_xp').getScore(entity.scoreboardIdentity)}`)
    form.show(entity).then(data => {
        switch (data.selection) {
            case 0:
                form(entity)
                break;
        }
    })
}
scenic wolfBOT
#
Debug Result

There is an error in this [code](#1147193285778100224 message):

<repl>.js:10:17 - error TS2349: This expression is not callable.
  Type 'ActionFormData' has no call signatures.

10                 form(entity)
                   ~~~~

split forum
#

I didnt send the whole file just the part having issues

#

I guess ill send the whole file tommorrow the button back was done the same format as the button that sends you there

scenic wolfBOT
#
Debug Result

There are 4 errors in this [code](#1147193285778100224 message):

<repl>.js:6:28 - error TS2304: Cannot find name 'world'.

6     form.button(`attack: ${world.scoreboard.getObjective('attack').getScore(entity.scoreboardIdentity)}`)
                             ~~~~~

``````ansi
<repl>.js:7:36 - error TS2304: Cannot find name 'world'.

7     form.button(`til next level: ${world.scoreboard.getObjective('attack_r').getScore(entity.scoreboardIdentity)}`)
                                     ~~~~~

``````ansi
<repl>.js:8:27 - error TS2304: Cannot find name 'world'.

8     form.button(`total: ${world.scoreboard.getObjective('attack_xp').getScore(entity.scoreboardIdentity)}`)
                            ~~~~~

``````ansi
<repl>.js:12:17 - error TS2349: This expression is not callable.
  Type 'ActionFormData' has no call signatures.

12                 form(entity)
                   ~~~~

kindred pilot
split forum
#

Which 1

#

@kindred pilot hey after i get back from work can you help me look threw my script and help me find out why my scoreboard leveling scripts are acting weird

kindred pilot
kindred pilot