Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

My dataStore loads random data?

Asked by 8 years ago

Some Players in my game have complained about having their Data being changed on entering a different server,some aren't affected and some say that it happens when I use the shutdown all servers button . Apparently the intValues that the datastores are saving are being replaced by random numbers?

I can't seem to find anything wrong with the scripts. I'm hoping someone else can review my script and reassure this should work as intended.

01local saveAs = "HS"
02 
03local dataStore = game:GetService("DataStoreService"):GetDataStore(saveAs)
04local Players = game:GetService("Players")
05 
06Players.PlayerAdded:connect(function(player)
07    local stats = player:WaitForChild("Hstats")
08    local data = dataStore:GetAsync(player.UserId)
09    if data then
10        for name,value in next, data do
11            stats[name].Value = value
12        end
13    end
14end)
15 
View all 44 lines...

1 answer

Log in to vote
0
Answered by 8 years ago

This is my best guess. The HS data store probably is used in more games then just yours. Other games are able to change your datastore also, so you should name it something unique, e.x. HS9280924. Also in case someone on scriptinghelpers is trolling, I would not actually post the datastore on here.

0
Did not know about that o_o thanks for letting me know. PsychonautX 15 — 8y
0
Im sorry, but according to the wiki, and some other person, it can only be changed from your game/universe. But thats still the only reason I can think of without seeing your script to get the info. FrostTaco 90 — 8y
Ad

Answer this question