Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Datastore2 is not saving. Even though it says Saved DATA in the output. (?)

Asked by 9 days ago
Edited 9 days ago

Hi! So, I'm using Datastore2 to try and save the data that I want to be saved but, It does not save

Have a look at the script (I tried using Remote Events and normally and they both did not work).

local datastore2 = require(game.ServerScriptService.MainModule)

datastore2.Combine("DATA", "Stage")

game.Players.PlayerAdded:Connect(function(player)
    local stagesStore = datastore2("Stage", player)

    local function changeStage(amount)
        game.ReplicatedStorage.EventRemotes.ChangeStage:FireClient(player, amount)
    end

    local ls = Instance.new("Folder",player)
    ls.Name = "leaderstats"

    local Stage = Instance.new("IntValue")
    Stage.Name = "Stage"
    Stage.Value = stagesStore:Get(1) 
    Stage.Parent = ls

    stagesStore:OnUpdate(changeStage)


   ls.Parent = player
end)


0
Answered, also can you set my answer on your last post as the answer? CaioAlpaca 342 — 8d
0
Oh, sorry that i didnt answer you. Baselistic 79 — 8d

1 answer

Log in to vote
1
Answered by 8 days ago

You need a boolValue named SaveInStudio into serverstorage.

0
I did Baselistic 79 — 8d
0
And it did not work. Baselistic 79 — 8d
0
are you changing the amount via client? if so dont, change it via server with YouData:Increment(value) CaioAlpaca 342 — 8d
Ad

Answer this question