#(Resolved)

1 messages · Page 1 of 1 (latest)

tender nebula
#

I am not able to fix the errors plz help

compact mortarBOT
#
Debug Result

There are 21 errors in this [code](#1137629753289998388 message).
Please read the attached file for the result.

blissful cove
#

maybe

#

Your error is all about parenthesis...
What tools do you use?

tender nebula
blissful cove
#

maybe

tender nebula
#

ok

blissful cove
#

please try

tender nebula
#

error : page_Home is not a function

#

at js: 34 , 24

#

@blissful cove

blissful cove
#
function page_Home(player) {
    let form = new ActionFormData()
    form.title(`§l§eBank`);
    form.body(`§bWithDraw or Deposit your §aMoney§r here!`);
    form.button(`§cDeposit`);
    form.button(`§cWithdraw`);
    //page_Home.show(player).then((result) => {     BEFORE
    form.show(player).then((result) => {          //AFTER
        if (result.selection == 0) page_Deposit(player)
        if (result.selection == 1) page_withdraw(player)
    })
}
#

@tender nebula change here

tender nebula
#

ok i will try

#

same error

#

@static fossil Need ur help

static fossil
#

How can I assist?

tender nebula
#

i am getting same error if i fix it

static fossil
#

Which error?

tender nebula
#

error : page_Home is not a function
at js: 34 , 22

vital mothBOT
#
Program Output
(node:22) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use ​`node --trace-warnings ...​` to show where the warning was created)
/home/jail/prog.js:1
import { world, system, Player, MinecraftBlock
static fossil
#

I will fix

tender nebula
#

ok thank you

static fossil
#

@tender nebula

tender nebula
#

ok i will try it

static fossil
#

tender nebula
#

@static fossil Thank you for your efforts! and it works fine . i wanted to know what was the issue .

#

(Resolved) Bank System

static fossil
#

It should be const player = data.damagingEntity; not const player = data.entity;

#

If you need any more assistance, Ping me

tender nebula
#

Ok

tender nebula
#

@static fossil Hey sorry for disturbing you , In my bank system for the deposit and withdraw we have to scroll but i need a text field can you do it?

tender nebula
#

Bank System

tender nebula
#

@static fossil

static fossil
#

How can I assist?

static fossil
#

Which form function? Example Main_form(player)

tender nebula
#

page_Deposit , page_withdraw

#

for deposit we have to use slider but i don't need that , i want to use text field

static fossil
#

I will add:

tender nebula
#

ok

static fossil
vital mothBOT
#
Program Output
(node:22) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use ​`node --trace-warnings ...​` to show where the warning was created)
/home/jail/prog.js:1
import { world, system, Player, MinecraftBlock
tender nebula
#

ok wait i will try it

compact mortarBOT
#
Debug Result

There are 24 errors in this [code](#1137629753289998388 message).
Please read the attached file for the result.

tender nebula
#

@static fossil

sacred kettle
#

Give me your error

#

where is error there is solution

tender nebula
sacred kettle
#

show me your all async code

tender nebula
#

@sacred kettle here it is

#

i tested it

#

same error

sacred kettle
#

nah, thats not async only async code

tender nebula
#

huh?

sacred kettle
#

that error means you have error somehwere in async code

#

place

.catch(er=>console.error(er,er.stack));

after every "then" methods

#

so it will diplay where your issue is

tender nebula
#

where to place it?

#

ok

compact mortarBOT
#
Debug Result

There are 24 errors in this [code](#1137629753289998388 message).
Please read the attached file for the result.

tender nebula
#

wait

hot mountain
#

From what the bot says it looks like formValues may not be defined, and player.scoreboardIdenty is undefined

#

@sacred kettle does this look right from the logs

sacred kettle
#

ya, like evrything could be undefined, but how to explain to him

#

¯_(ツ)_/¯

hot mountain
#

chatgpt

tender nebula
#

not chatgpt

#

?

sacred kettle
#

google, that error

tender nebula
#

huh

sacred kettle
#

just don't read properties from possibly undefined values

tender nebula
#

ok

vital mothBOT
#
Program Output
/home/jail/prog.js:1
world.afterEvents.entityHitEntity.subscribe((data) => {
^

ReferenceError: world is not defined
    at Object.<anonymous> (/home/jail/prog.js:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Mo
static fossil
vital mothBOT
#
Program Output
(node:22) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use ​`node --trace-warnings ...​` to show where the warning was created)
/home/jail/prog.js:1
import { world } from "@minecraft/server";
^^^
compact mortarBOT
#
Debug Result

There are 32 errors in this [code](#1137629753289998388 message).
Please read the attached file for the result.

static fossil
#

💀The code works in game with no problems

fathom tangle
static fossil
#

Add the objective "bank" and "money" and set the scores for both 1

#

Take this code:```js
const allObj = [
'money',
'bank'
];

system.runInterval(() => {
for (const allObjs of allObj) {
try {
world.getDimension('overworld').runCommandAsync(scoreboard players add @a ${allObjs} 0)
world.scoreboard.addObjective(allObjs, allObjs);
} catch (error) { }
}
});

tender nebula
#

[Scripting][error]-Unhandled promise rejection: TypeError: not a function

#

@static fossil

static fossil
#

💀 The code there?

#

Or the form

tender nebula
#

form is ok but when i pressed the withdraw and deposit the error pops up

#

what is the issue?

static fossil
#

The code works for me

tender nebula
#

can you show?

static fossil
#

@tender nebula

tender nebula
#

how?

static fossil
#

Your game?

tender nebula
#

what

#

wdym?

#

by your game

static fossil
#

I don't know how

tender nebula
#

created new world and tested it

#

same error

static fossil
#

💀

tender nebula
#

hehe

static fossil
#

I don't know why you are facing this error

tender nebula
#

me to

#

any guess what does the error mean?

knotty edge
#

skill issue

tender nebula
#

?

static fossil
#

Do you know why he can't use this code and I can?

#

He says that to everyone

tender nebula
#

@static fossil now no need i fixed it and i am closing the post , those who helped me thank you for your efforts