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

DataStore refusing to load data?

Asked by 6 years ago

I have tried numerous ways to get it to work, unsure if it is a bug or not but can someone help me please The error I keep receiving is 19:29:22.015 - 502: API Services rejected request with error: HTTP 0 (HTTP 403 (HTTP/1.1 403 Forbidden)) Here is the script if you want to have a look at it.

01local data = game:GetService("DataStoreService")
02local datastore = data:GetDataStore("RebornDataInitialiser")
03 
04game.Players.PlayerAdded:Connect(function(player)
05    local userid = tostring(player.userId)
06    local data1 = Instance.new("Folder")
07    data1.Name = "Data"
08    data1.Parent = player
09    local xp = Instance.new("IntValue")
10    xp.Name = "XP"
11    xp.Value = 0
12    xp.Parent = data1
13    local level = Instance.new("IntValue")
14    level.Name = "Level"
15    level.Value = 0
View all 32 lines...
1
Actually, you can type userId as of now and it still works. PoePoeCannon 519 — 6y
1
But, it is deprecated so it would be best to start using UserId PoePoeCannon 519 — 6y
1
Make sure the API Services are enabled first. You can check this if you go to the game settings and enable "Enable Studio Access to API Services" BloxRoxe 109 — 6y
0
I have already MaximumOverdriven 152 — 6y
View all comments (2 more)
0
legends say the datastore refuses to load data to this day. ShadyShock 77 — 6y
0
Make sure that it is your game, make sure you have internet, etc greatneil80 2647 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

I’m not so sure but when I’ve tested this out before I’d get that error message and I would just put some waits in, which would mostly resolve my issue

01local data = game:GetService("DataStoreService")
02local datastore = data:GetDataStore("RebornDataInitialiser")
03 
04game.Players.PlayerAdded:Connect(function(player)
05    local userid = tostring(player.userId)
06wait(2)
07    local data1 = Instance.new("Folder")
08    data1.Name = "Data"
09    data1.Parent = player
10wait(2)
11    local xp = Instance.new("IntValue")
12    xp.Name = "XP"
13    xp.Value = 0
14    xp.Parent = data1
15wait(2)
View all 36 lines...
0
I managed to make it work before your answer, but considering your the only person to take the initiative and help, I'll accept your answer :) MaximumOverdriven 152 — 6y
0
Aww thanks alteast I’m not left out GizmoProductions 61 — 6y
Ad

Answer this question