Hey there. I’m getting an error and I am not sure how to fix it
502: API Services rejected request with error. HTTP 403 (Forbidden) - Server - Leaderstats:11
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("MoneyStats") -- Change this with a different name.
game.Players.PlayerAdded:Connect(function(Player)
local Leaderstats = Instance.new("Folder", Player)
Leaderstats.Name = "leaderstats"
local Currency = Instance.new("IntValue", Leaderstats)
Currency.Name = "Skill" -- Change "Money" with your currency.
Currency.Value = 0
local Data = DataStore:GetAsync(Player.UserId)
if Data then
Currency.Value = Data -- Change this if you have added more currencies.
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
DataStore:SetAsync(Player.UserId, Player.leaderstats.Skill.Value) -- Change "Money" with your currency.
end)
Thank you for the help.