#my code works 5 min ago and now it doesn't work

1 messages ยท Page 1 of 1 (latest)

bold crypt
trim rainBOT
#
Debug Result

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

bold crypt
trim rainBOT
#
Debug Result

There are 9 errors in this [code](#1198878875858522163 message):

message.js:1:1 - error TS2304: Cannot find name 'world'.

1 world.afterEvents.playerInteractWithEntity.subscribe((event) => {
  ~~~~~

``````ansi
message.js:3:20 - error TS2304: Cannot find name 'getScore'.

3     const freeze = getScore(target, "Freeze")
                     ~~~~~~~~

``````ansi
message.js:6:19 - error TS2304: Cannot find name 'ActionFormData'.

6     const g = new ActionFormData(); {
                    ~~~~~~~~~~~~~~

``````ansi
message.js:19:37 - error TS2304: Cannot find name 'page_listPlayerInventory'.

19             if (r.selection == 0) { page_listPlayerInventory(player, target); }
                                       ~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
message.js:20:37 - error TS2304: Cannot find name 'playerinfo'.

20             if (r.selection == 1) { playerinfo(player, target); }
                                       ~~~~~~~~~~

``````ansi
message.js:40:37 - error TS2304: Cannot find name 'warnmenu'.

40             if (r.selection == 4) { warnmenu(player,target); }
                                       ~~~~~~~~

``````ansi
message.js:41:37 - error TS2304: Cannot find name 'gives'.

41             if (r.selection == 5) { gives(player,target); }//Give Player
                                       ~~~~~

``````ansi
message.js:43:37 - error TS2304: Cannot find name 'manageMoney'.

43             if (r.selection == 7) { manageMoney(player,target); }
                                       ~~~~~~~~~~~

``````ansi
message.js:45:36 - error TS2304: Cannot find name 'clearinv'.

45             if (r.selection == 9) {clearinv(player,target);}
                                      ~~~~~~~~

bold crypt
trim rainBOT
#
Debug Result

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

message.js:1:1 - error TS2304: Cannot find name 'world'.

1 world.afterEvents.playerInteractWithEntity.subscribe((event) => {
  ~~~~~

``````ansi
message.js:3:20 - error TS2304: Cannot find name 'getScore'.

3     const freeze = getScore(target, "Freeze")
                     ~~~~~~~~

``````ansi
message.js:6:19 - error TS2304: Cannot find name 'ActionFormData'.

6     const g = new ActionFormData();
                    ~~~~~~~~~~~~~~

``````ansi
message.js:19:37 - error TS2304: Cannot find name 'page_listPlayerInventory'.

19             if (r.selection == 0) { page_listPlayerInventory(player, target); }
                                       ~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
message.js:20:37 - error TS2304: Cannot find name 'playerinfo'.

20             if (r.selection == 1) { playerinfo(player, target); }
                                       ~~~~~~~~~~

``````ansi
message.js:41:37 - error TS2304: Cannot find name 'gives'.

41             if (r.selection == 5) { gives(player,target); }//Give Player
                                       ~~~~~

``````ansi
message.js:43:37 - error TS2304: Cannot find name 'manageMoney'.

43             if (r.selection == 7) { manageMoney(player,target); }
                                       ~~~~~~~~~~~

``````ansi
message.js:45:36 - error TS2304: Cannot find name 'clearinv'.

45             if (r.selection == 9) {clearinv(player,target);}
                                      ~~~~~~~~

#
Debug Result

There are 9 errors in this [code](#1198878875858522163 message):

message.js:1:1 - error TS2304: Cannot find name 'world'.

1 world.afterEvents.playerInteractWithEntity.subscribe((event) => {
  ~~~~~

``````ansi
message.js:3:20 - error TS2304: Cannot find name 'getScore'.

3     const freeze = getScore(target, "Freeze")
                     ~~~~~~~~

``````ansi
message.js:6:19 - error TS2304: Cannot find name 'ActionFormData'.

6     const g = new ActionFormData(); {
                    ~~~~~~~~~~~~~~

``````ansi
message.js:19:37 - error TS2304: Cannot find name 'page_listPlayerInventory'.

19             if (r.selection == 0) { page_listPlayerInventory(player, target); }
                                       ~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
message.js:20:37 - error TS2304: Cannot find name 'playerinfo'.

20             if (r.selection == 1) { playerinfo(player, target); }
                                       ~~~~~~~~~~

``````ansi
message.js:40:37 - error TS2304: Cannot find name 'warnmenu'.

40             if (r.selection == 4) { warnmenu(player,target); }
                                       ~~~~~~~~

``````ansi
message.js:41:37 - error TS2304: Cannot find name 'gives'.

41             if (r.selection == 5) { gives(player,target); }//Give Player
                                       ~~~~~

``````ansi
message.js:43:37 - error TS2304: Cannot find name 'manageMoney'.

43             if (r.selection == 7) { manageMoney(player,target); }
                                       ~~~~~~~~~~~

``````ansi
message.js:45:36 - error TS2304: Cannot find name 'clearinv'.

45             if (r.selection == 9) {clearinv(player,target);}
                                      ~~~~~~~~

wide mirage
#

You have 10 selection cases and only 9 buttons

bold crypt
raven oxide
#

Native prototype error happens if you are in the game for a long time- try restarting mc

#

Why do you have {} wrapped around the buttons & callback?

#

Try removing those too