Okay. I have a script (below), and I also have a value that equals 10 (screenshot below). When I enter the game theoretically the value should be 10, but why, it is 0? Then when I click it goes down (one click -1 to the value), and my script should print the result when changing. It does this, but then when I go back into the game value is 0. Why?
P.S. - My script must save the value for the whole game, that is, when a player changes it for all in the game it also changes, that is, it is not the DataStore of one player
Do you see the datastore warnings in the output?
From looking in the output, it seems you are sending to many datastore requests. It is recommended to only store things in a datastore on like when a player leaves or the server shuts down or something like that.
Yes, I know. But how do I do otherwise, if I need the value to be for all players so that it is updated every time someone reduces or increases it? Yes, and the script does not work for warnings. Because I have it in other games, and it is, but it works fine there.
I might be completely misunderstanding the question, but you are setting the value of egg health when the script first runs. It is might see that the value of whatever it calls on is 0. It also seems that you are setting the value of egg health on the client, so it doesn’t replicate to other clients. Sorry if this doesn’t answer your question.
Okay, I’ll explain it again. I manually set the value of the egg to 10. But when I enter the game it is 0. Here is a screenshot of Intvalue which is 10.
are you viewing the value in server view when playing the game? And it also seems like you are loading in a previous value for egg health on the client
And could you elaborate, because there’s a lot I don’t understand, you. (I’m a little dumb).
When you are playing the game, you can swap views (client → server, server → client) in the test tab near the top.
Plus, when the local script runs, you are setting
EggHealth.Value = getDataRemote:InvokeServer("EggHealth", key)