Okay, in the screenshot you can see my script which should theoretically save the IntValue when the player leaves the game. I need this IntValue to be one for the whole game, that is, if a player changes it, the other players will see it. The problem is that when I click on the button, it changes the IntValue, but in the script, if I put it
to print, it will say that the IntValue is 10, although I’ve done clicks and it should be 5. Also, for some reason, the second print just doesn’t execute. You can see it all in the screenshot. If anything I told manually beforehand that IntValue = 10. And the idea is that the players will click on the button and it will change for all players and also save. HELP PLEASE!
If on client, it only updates for the client and stays 10 for the server.
and the second print, i think when you leave the game the game closes faster than the data can save (this will still save your data) but since the game closed before it saved them, the script didn’t execute as the game was already closed.
And how do I make sure that first there was a save, and then exit. Although you can probably make a loop every 10 seconds to make a save, you can do so?