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
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.