#actionform help

1 messages · Page 1 of 1 (latest)

steady tangleBOT
#
Debug Result

JavaScript/TypeScript code blocks not detected in [message](#1122880484230316143 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.

#
Debug Result

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

text.js:3:19 - error TS2304: Cannot find name 'ActionFormData'.

3   const gui = new ActionFormData()
                    ~~~~~~~~~~~~~~

upbeat grotto
#

use `` on string, not ''

#
const Stats = (player) => {
  const gui = new ActionFormData()
    gui.title('§f- §dStats §f-§r')
    gui.body(`  §3Money: §7${config.CURRENCY}${metricNumbers(scores["money"])} `)
    gui.button(`§l§4Close Menu`)
    gui.show(player)
}
#

also, if you dont need result then you wont need to wait for form promise

#

you dont need .then()

#

what line?

steady tangleBOT
#
Debug Result

There are 7 errors in this [code](#1122880484230316143 message):

<repl>.js:2:7 - error TS2451: Cannot redeclare block-scoped variable 'world'.

2 let { world, system } = mc;
        ~~~~~

  @minecraft/server.d.ts:8257:15
    8257         const world: World;
                       ~~~~~
    'world' was also declared here.

``````ansi
<repl>.js:2:14 - error TS2451: Cannot redeclare block-scoped variable 'system'.

2 let { world, system } = mc;
               ~~~~~~

  @minecraft/server.d.ts:8256:15
    8256         const system: System;
                       ~~~~~~
    'system' was also declared here.

``````ansi
<repl>.js:2:25 - error TS2304: Cannot find name 'mc'.

2 let { world, system } = mc;
                          ~~

``````ansi
<repl>.js:12:25 - error TS2304: Cannot find name 'mc'.

12   Object.defineProperty(mc.Entity.prototype, 'scores', {
                           ~~

``````ansi
<repl>.js:24:91 - error TS2731: Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'.

24           if (!entity.scoreboardIdentity) entity.runCommand(`scoreboard players set @s "${obj}" ${score}`);
                                                                                             ~~~

``````ansi
@minecraft/server.d.ts:8256:15 - error TS2451: Cannot redeclare block-scoped variable 'system'.

8256         const system: System;
                   ~~~~~~

  <repl>.js:2:14
    2 let { world, system } = mc;
                   ~~~~~~
    'system' was also declared here.

``````ansi
@minecraft/server.d.ts:8257:15 - error TS2451: Cannot redeclare block-scoped variable 'world'.

8257         const world: World;
                   ~~~~~

  <repl>.js:2:7
    2 let { world, system } = mc;
            ~~~~~
    'world' was also declared here.

upbeat grotto
#

where's your full code? i dont see any promise on the thing you sent

#

i dont see any "scores" variable there, are you sure its that all?

upbeat grotto
#

how did you fixed it?

steady tangleBOT
#
Debug Result

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

test.js:3:20 - error TS2307: Cannot find module '../config' or its corresponding type declarations.

3 import config from "../config";
                     ~~~~~~~~~~~

``````ansi
test.js:30:81 - error TS2339: Property 'displayName' does not exist on type 'Player'.

30   const recipientList = world.getPlayers().filter(p => p !== sender).map(p => p.displayName);
                                                                                   ~~~~~~~~~~~

``````ansi
test.js:31:7 - error TS2339: Property 'dropdown' does not exist on type 'ActionFormData'.

31   gui.dropdown("Recipient", recipientList, 0);
         ~~~~~~~~

``````ansi
test.js:33:7 - error TS2339: Property 'input' does not exist on type 'ActionFormData'.

33   gui.input("Amount", "0", "numeric");
         ~~~~~

``````ansi
test.js:35:26 - error TS2345: Argument of type '() => void' is not assignable to parameter of type 'string'.

35   gui.button("Transfer", () => {
                            ~~~~~~~

``````ansi
test.js:36:32 - error TS2339: Property 'getResponse' does not exist on type 'ActionFormData'.

36     const recipientIndex = gui.getResponse().getDropdownResponse(0).getSelectedIndex();
                                  ~~~~~~~~~~~

``````ansi
test.js:38:33 - error TS2339: Property 'getResponse' does not exist on type 'ActionFormData'.

38     const amount = parseInt(gui.getResponse().getInputResponse(0).getTypedText(), 10);
                                   ~~~~~~~~~~~

``````ansi
test.js:52:22 - error TS2551: Property 'getPlayer' does not exist on type 'World'. Did you mean 'getPlayers'?

52 const player = world.getPlayer("sender_username"); // Replace with the username of the player
                        ~~~~~~~~~

  @minecraft/server.d.ts:17579:5
    17579     getPlayers(options?: EntityQueryOptions): Player[];
              ~~~~~~~~~~
    'getPlayers' is declared here.

upbeat grotto
#

you have so many duplicated imports

#

i was talking about this one

#

chatgpt doesnt know script api

tardy oar
forest fox
#

@modest harness How on earth do u do that

#

Like the money showing thing

#

Yes

#

I don’t want do copy u but

#

I’m trying to do the same

#

Yes

#

Multiple

#

But I don’t need a new one

#

I just want to know 2 things:

#
  1. How do u get the custom “Stats” writing thing
#

Ok ty

#

Oh

#

Ten font?
Sry what is that

#

What is it

#

Can it be downloaded?

#

Ok
But what is the color code?
For example:
§3 = Cyan

#

Ok

#

But what do u do to access it?

#

Cause I’ve been wondering for months how people use it!

#

Wait so like where do u have to customise

#

It

#

How to get the texture pack?

modest harness
#

Is that galaxy’s ui?

#

@main fjord Sus

forest fox
#

How to make it?

modest harness
#

they scammed u I’m pretty sure it’s galaxy’s ui

#

It's ok I believe you

#

It just looks similar

forest fox
#

My

#

@modest harness

#

Can I see ur whole gui (script or screenshoted, idc)?

#

K

main fjord
modest harness
#

Oh probs just made by csc then

#

cos he likes that design