I have problem with my data store when i run the script theres an error saying 502: API Services rejected request with error. HTTP 403 (Forbidden) AND IM THE OWNER OF GAME I HAVE API SERVICES ON I HAVE HTTP ON I HAVE EVERYTHING TO HAVE TO WORK. This is my script:
local DataStoreService = game:GetService("DataStoreService")
local DataStoreTest1 = DataStoreService:GetDataStore("DataStoreTest1")
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder",plr)
leaderstats.Name = "leaderstats"
local Cash = Instance.new("IntValue",leaderstats)
Cash.Name = "Cash"
local ID = plr.UserId
print("The Player that joined id is "..ID)
print("And the player name is:"..plr.Name)
local data
local Saved, err = pcall(function()
data = DataStoreTest1:GetAsync(ID)
end)
if Saved then
print("Everything alright with loading data of"..plr.Name)
Cash.Value = data
else
print("Something dont work")
warn(err)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local data = plr.leaderstats.Cash.Value
local ID = plr.UserId
DataStoreTest1:SetAsync(ID, data)
end)
Plz send down in the answers THX.
