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

When rejoining the game my stage value that was saved is randomized?

Asked by 6 years ago

Now, i'm unsure if this is happening to players playing the game, but it has been happening for me and the game owner.

I have a datastore scirpt which loads the player's data when joining and saves it when leaving the game. However whenever I rejoin, most of the time my stage would be completely random.

01local DS = game:GetService("DataStoreService"):GetDataStore("SomeDataButItsNotTheActualName")
02 
03game.Players.PlayerAdded:connect(function(plr)
04    local leaderstats = Instance.new("Model")
05    leaderstats.Name = "leaderstats"
06    leaderstats.Parent = plr
07 
08    local stage = Instance.new("NumberValue")
09    stage.Name = "Stage"
10    stage.Parent = leaderstats
11 
12    local cash = Instance.new("NumberValue")
13    cash.Name = "Cash"
14    cash.Parent = leaderstats
15 
View all 44 lines...

(snipped out irrelevant parts of the script)

So, what am I doing wrong?

0
There is a chance that there is another script changing the value greatneil80 2647 — 6y
0
I'll go look through them again CrystallineShard 47 — 6y

Answer this question