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

Datastore is not saving saving changes in data despite no errors in output?

Asked by
Robb12 12
5 years ago
Edited 5 years ago

Hi I have been trying to code a data store and have run into an issue with the code I am trying to use

the script doesn't show any errors in the output bar, it just does not save any change in the data so at this point I am at a loss for what to do

01local DSS = game:GetService("DataStoreService")
02local Players = game:GetService("Players")
03local Server = game:GetService("ServerStorage")
04 
05local DS = DSS:GetDataStore("Eldaronservertest1238")
06 
07Players.PlayerAdded:Connect(function(Player)
08    if Player ~= nil then
09        local UserId = Player.UserId
10        local Key = "KeyScope:  "..UserId
11        local MyData = DS:GetAsync(Key)
12        local Folder = Instance.new("Folder")
13        Folder.Name = tostring(UserId)
14        local currency = Instance.new("NumberValue")
15        Folder.Parent = Server
View all 45 lines...

1 answer

Log in to vote
0
Answered by
Robb12 12
5 years ago

Issue was I put GetAsync at the bottom of the script instead of SetAsync

0
... plox proof read your code before you post a question. BashGuy10 384 — 5y
Ad

Answer this question