#how to cancel event?
1 messages · Page 1 of 1 (latest)
chatSend after and before Events are in still experimental.
you can't cancel beforeEvents if you're doing data.cancel = true inside a system.run()
then your if check is failing?
no
There are 3 errors in this [code](#1224829196216438847 message):
[36mmessage.js[0m:[33m75[0m:[33m18[0m - [31merror[0m[30m TS18048: [0m'cr' is possibly 'undefined'.
[7m75[0m const casr = cr.getScore(player);
[7m [0m [31m ~~[0m
``````ansi
[36mmessage.js[0m:[33m76[0m:[33m24[0m - [31merror[0m[30m TS2304: [0mCannot find name 'money'.
[7m76[0m const moneyScore = money.getScore(player);
[7m [0m [31m ~~~~~[0m
``````ansi
[36mmessage.js[0m:[33m77[0m:[33m16[0m - [31merror[0m[30m TS18048: [0m'qpoint' is possibly 'undefined'.
[7m77[0m const qp = qpoint.getScore(player);
[7m [0m [31m ~~~~~~[0m
fix those and see
also test the event without any code to see if it is working or not
oh it's prob logic issue
when trying to type .warp hub
you're checking if any string matched inside the commands array.
However, you forgot to split it into tokens. And because of the extra hub, it doesn't find a matching string.
have you fixed ur logic issue?
nothing?
whats in message
yep
what do you type
pretty sure cmds and arg are undefined
bruh just type here what you type in game
the corrds need to be object with properties x y and z
{x:22,y:33,z:54}
const [cmds, arg] = msg.split(" ");
it's there
Cold
lol
#1224829196216438847 message
Me 10 seconds after opening my pack who only have 3 lines of code: "Nah, I'll do this tomorrow"
can you send your pack
wired
do console.warn(ev.cancel)
The code is "broken" which implies that it was potentially working before. However, I don't see how it was working unless you haven't made the warp system the last time you checked.
if (cmds === commands[0]) {
ev.cancel = true;
system.run(()=>{
return ( warploc[arg] ? player.teleport(warploc[arg] : undefined )
})
}
try new world
you said you tried this? no?
world.beforeEvents.chatSend.subscribe((event) => {
event.cancel = true;
});
try new world than
you got other pack in that world?
the event isn't canceled so that won't be a problem
i have no idea than
good luck with that