#Weird crosstalk between scripts
12 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
all script files of a type are basically merged into one file, then parsed
so you only need globals for cross type communication
So.. all recipes for x event are counted as one file? Or all files from one folder?
all files in one type
so server_scripts, startup_scripts
events are seperate
its only files
Ooohh.. okay that makes sense 😅 Thx :D
server_scripts/test.js
const value = 1
let foo = 'bar'
global.thingy = [1,2,3]
server_scripts/atest.js
console.log(value) //logs 'undefined'
// this is because this file is alphabetically before the other one, and so gets run before it. use //priority: 10 at the top of the other to make it load first
server_scripts/test2.js
console.log(foo) // logs 'bar'
value = 2 // errors due to reasigning constant
ah 👍
