Hello everyone, i need help with a script that puts my server "too sleep" after a certain time by using the Maintenance Mod command as a function. The function already works independently if i use it myself in game, but i keep getting errors on my script, and I'm not programming literate enough by any means to figure out where I'm going wrong.
#Total KubeNube, need help with a server script
23 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Paste version of maintenance.js from @thorny gorge
??neversay
Never say 'it crashed', 'it errored', or 'it didn't work' without providing the full crash report, log, and scripts!
Paste version of server.log from @thorny gorge
Try this
ServerEvents.loaded(event => {
event.server.scheduleInTicks(60 * 60 * 20, function (callback) {
event.server.runCommand('/function serverfunctions:m_off')
})
event.server.scheduleInTicks(525 * 60 * 20, function (callback) {
event.server.tell('Server is going to sleep in 15 minutes!')
})
event.server.scheduleInTicks(530 * 60 * 20, function (callback) {
event.server.tell('Server is going to sleep in 10 minutes!')
})
event.server.scheduleInTicks(535 * 60 * 20, function (callback) {
event.server.tell('Server is going to sleep in 5 minutes!')
})
event.server.scheduleInTicks(539 * 60 * 20, function (callback) {
event.server.tell('Good Night Everyone!')
})
event.server.scheduleInTicks(540 * 60 * 20, function (callback) {
event.server.runCommand('/function serverfunctions:m_on')
})
})
Ill take a look, thank you. What are the additional numbers for?
OH i see.... Schedule in ticks... 540 minutes * 60 seconds * 20 ticks right?

