You need to store your mods data variables in the global table so they're saved/loaded with the game.
Right now because they're stored as local variables they get reset every time a new player joins the game or every time the game is saved, exited, and loaded.
This results in desyncs in MP and breaks the replay in single player.