#how to run a different file in a block?

1 messages · Page 1 of 1 (latest)

ionic junco
#

something like this

world.beforeEvents.chatSend.subscribe((data) => {
    const {message, sender} = data
    if (message.includes("!", 0)) return "./chat_commands.js"```
amber gust
#

You will want to export the function or definition from the file your are wanting to use something. Then you need to import it to the script you want to use it.

From file you already defined the function or definition

export function test...

In other file...

import { test } from "./chat_commands.js"

test()