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)
01 | local DS = game:GetService( "DataStoreService" ) |
02 | local DS 1 = DS:GetDataStore( "SaveJoins" ) |
04 | game.Players.PlayerAdded:Connect( function (player) |
05 | local leaderstats = player:WaitForChild( "leaderstats" ) |
06 | local joins = Instance.new( "IntValue" ) |
08 | joins.Parent = leaderstats |
09 | local PlayerUserId = "Player_" ..player.UserId |
12 | local success, errormessage = pcall ( function () |
13 | data = DS 1 :GetAsync(PlayerUserId) |
16 | joins.Value = data + 1 |
23 | game.Players.PlayerRemoving:Connect( function (player) |
24 | local PlayerUserId = "Player_" ..player.UserId |
25 | local data = player.leaderstats.Joins.Value |
26 | local success, errormessage = pcall ( function () |
27 | DS 1 :SetAsync(PlayerUserId, data) |