Okay, as you can see here is my script. My goal is to keep one value that players can change by clicking the button, but I need it to be one value for the whole game. That is, on the other server, the player changed it, and the first player saw the change. If you look at the output, you’ll see that print says that the value is saved somehow, but when I enter the game it equals 10. WHY???
You’re datastore will queue up quickly because you’re saving the datastore multiple times in one key in a game instance, I suggest you use game:BindToClose()
.
Can you please give me an example of a script, where to insert it, etc?
game:BindToClose(function()
-- save data, then to get data add a debounce when the first player joins.
end
Also, by your text, it works with a single person, right?
it should work like this. There is a value of for example 10. Some player changed it to 9. And the other players it also changed, then the first player went out, and the second changed the value to 8. Came back the first and sees that the value is 8. But I’m like three days beating with this script, and still nothing works. I would really like someone to throw the script or at least an example, so I understand how to do it right. Because I am a beginner (7 months), so there is still much I do not know.
You still haven’t answered my question, does it work for a single player or does it not?
Also, I’m not here to give you a script, I’m here to give you the information needed for you to successfully do this and for you to learn from this information, giving you a script you hardly understand won’t help you at all.
So far it works like this, the player goes in and can click, and the number decreases, but others do not. Then he leaves and when he comes back the number is the same (that is, it has not changed)
So, my previous solution would work, replace the playerremoved event with a game:BindToClose()
function that saves the data, then add a playeradded event that has a debounce (specifically a infinite one).
Okay, thanks. I’ll try. Thanks for helping me out, I appreciate it)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.