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

Data Store, What Did I Do Wrong, What Is It, And Filtering Enabled?

Asked by 6 years ago
Edited 6 years ago

So first, this whole data store thing, I'm lost. I simply want to save a player's in game currency, and the best I can find is some YouTube Videos that always come up with the same error: 17:54:59.286 - 502: API Services rejected request with error: HTTP 0 (HTTP 403 (HTTP/1.1 403 Forbidden)) and yes I did enable API Services. Here's the script, it was from a year ago and from AlvinBlox:

local DSService = game:GetService('DataStoreService'):GetDataStore('SZTravelingBuilders')
game.Players.PlayerAdded:Connect(function(plr)
-- Define Variables
local uniquekey = 'id-'..plr.userId

--Get Async
local GetSaved = DSService:GetAsync(uniquekey)
if GetSaved then
savevalue.Value = GetSaved[1]
else
local NumbersForSaving = {savevalue.Value}
DSService:SetAsync(uniquekey,NumbersForSaving)
end
end)

game.Players.PlayerRemoving:connect(function(plr)
local uniquekey = 'id-'..plr.UserId
local Savetable = {plr.leaderstats.Cash.Value}
DSService:SetAsync(uniquekey,Savetable)

end)

I didn't insert a new folder in the game, cause I already have one. Now I am wondering two things. One: Does Filtering Enabled affect this? I don't know too much about what it does, and to my understandings, it really is just used to protect people from stealing your stuff, same thing with API services. Can you tell me if it affects it and if so to turn it on or off. Two: What should I use to get my data store, change it(If it is a simple change, can you tell me it) and where to get a good understanding of what it is I'm doing. It is so wildly different from any other lines of code I have ever come across. Thank you for your time. If you can please help me that's great. I'm on the newer side to coding, and don't understand at all what the code is saying in data store.

Thank You For Your Time

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago

This error happens when trying to access DataStores of a place you do not own. In other words, make sure you entirely own this place. Team-create is not enough.

Not sure if other things cause the error but filtering is irrelevant.

0
It is a game with team create, what should I do, kick all others in team create? FlippinAwesomeCrew 62 — 6y
0
If you aren't the owner then all you can do is complain to roblox. cabbler 1942 — 6y
0
ok, but if the owner put in the script it would work, and could he just copy paste it from me, i have his email. FlippinAwesomeCrew 62 — 6y
Ad

Answer this question