As Twinsen said the script you're using is causing the desync. It's not written correctly in that it's storing mutable data outside the global table which means it's not saved and restored when someone joins the server.
I'm going to move this to modding help.
If you want to get ahold of me I'm almost always on Discord.