Hello! So I ran into a problem I am using Messaging Service to send values across to all servers. So pretty much you click the button and it adds the value to all the servers. I made it were if one server is up it sends a message with the value to the second server and the value updates. But if everyone leaves and no servers are up then when somebody does join the value is 0 because it doesn’t save to the server.
So pretty much I want to save the value to the server. If you need any further information or don’t understand something tell me!
Yes but even if he stored data to the server when the server was about to shutdown there would be no point because the server would be destroyed and the data wouldnt be able to be accessed.
Same way you make playerdata but with a key that is not connected with the player. You could use the key “Server” which would look something like this:
local ds = game:GetService("DataStoreService"):GetDataStore("GlobalValue")
local SERVER_KEY_NAME = "Server"
local success, data = pcall(function()
return ds:GetAsync(SERVER_KEY_NAME)
end)
if success then
print(data) -->> the server data
end
-->> some saving logic down here