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

DataStore not saving, printing error message?

Asked by 4 years ago
Edited 4 years ago

On line 17 I get print error I dont know why this is happening? I get error 502: API Services rejected request with error. HTTP 403 (Forbidden)

01local DS = game:GetService("DataStoreService")
02local DS1 = DS:GetDataStore("SaveJoins")
03 
04game.Players.PlayerAdded:Connect(function(player)
05    local leaderstats = player:WaitForChild("leaderstats")
06    local joins = Instance.new("IntValue")
07    joins.Name = "Joins"
08    joins.Parent = leaderstats
09    local PlayerUserId = "Player_"..player.UserId
10 
11    local data
12    local success, errormessage = pcall(function()
13        data = DS1:GetAsync(PlayerUserId)
14    end)
15    if success then
View all 35 lines...

2 answers

Log in to vote
2
Answered by
Zeuxulaz 148
4 years ago
Edited 4 years ago

Go to Game Settings in studio and press Options. Then, turn "Enable API Services" on.

Ad
Log in to vote
0
Answered by 4 years ago

Saw on line 11 I put local data.. I removed it and it worked?

0
Oh... that's strage. Zeuxulaz 148 — 4y

Answer this question