Hey so I’m trying to make a system that checks if a code already exists. If it doesn’t then it’ll add the code and the player’s ID to the dataStore. Why am I getting this error? 502: API Services rejected request with error. HTTP 403 (Forbidden)
local DataStore = game:GetService("DataStoreService")
local Classes = DataStore:GetDataStore("Classes")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = game.Players:GetPlayers()
-- Creating a class
local function createCode(Player,Code,success)
local code = Code
members = Classes:GetAsync(code)--Check if the code is already in use
if not members then
Classes:SetAsync(code, {Player.UserId})
return success
else
--Tell the user the code is taken, class codes must be unique
return
end
end
ReplicatedStorage.CreateCode.OnServerInvoke = createCode
Thanks!