const MINS = 5; 
const MESSAGES = [
    "§fUse [§e/spawn§f, §e/hub §for §e/lobby§f] to get back to spawn and use [§e/back§f] to return to your death point or previous location!",
    "§fUse [§e/checkpoint§f] to set your own checkpoints if you are struggling with levels!",
    "§fUse [§e/end§f] to end the game, clear inventories and reset stats!",
    "§fUse [§e/discord§f] to get discord server invite link!"
];
let messageIndex = 0;
let tickCounter = 0;
LevelEvents.tick(event => {
    if (!event.level.overworld) return;
    const interval = MINS * 60 * 20;
    tickCounter++;
    if (tickCounter >= interval) {
        const server = event.server;
        let currentMessage = MESSAGES[messageIndex];
        server.tell(currentMessage);
        messageIndex = (messageIndex + 1) % MESSAGES.length;
        tickCounter = 0;
    }
});