game:BindToClose(function()įor _, player in ipairs(Players:GetPlayers()) doĪnd there it is. Multiple functions can be bound, and they’ll all be called in a separate thread when the server shuts down. This can be done via the DataModel:BindToClose method, which takes a function as an argument, and is called when the server shuts down. In addition to saving upon a player’s removal, also save when the server shuts down. In these cases, the PlayerRemoving event listener is never called or doesn’t finish. A network error is encountered and the server therefore is forced to shut down.A developer manually shut it down via the game page.The 3 ways that come to mind are these (do give me more if there are): When a server is in the process of shutting down, its priority is shutting down and stops doing anything else. You might be thinking that this alone is fine. They join, you load their data, they leave, save that data. Players.PlayerRemoving:Connect(function(player: Player) ![]() Players.PlayerAdded:Connect(function(player: Player) Local cash_data_store = DataStoreService:GetDataStore("CashDataStore") Local Players, DataStoreService = game:GetService("Players"), game:GetService("DataStoreService") ![]() But why is this? What’s going on?įirst off, some data loading and saving scripts look kind of like this - in this very specific example it's saving cash ![]() If that’s you, you’re in the right place. Your script that saves data doesn’t seem to work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |