i tried to use data store for first time and everything seems ok but i keep getting error messages
12:31:38.285 - 502: API Services rejected request with error. HTTP 403 (Forbidden)
12:31:52.571 - ScriptNavigationHandler : No script currently available.
i made sure to allow studio access to api services but it still gives me errors
local DataStoreService = game:GetService("DataStoreService")
local Ticks = DataStoreService:GetDataStore("Ticks")
game.Players.PlayerAdded:Connect(function(player)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = player
local ticks = Instance.new("IntValue")
ticks.Name = "Ticks"
ticks.Parent = stats
local data
local success, errormessage = pcall(function()
data = Ticks:GetAsync(player.UserId.."-ticks")
end)
if success then
ticks.Value = data
else
print("There was an error while getting data")
warn(errormessage)
end
end)
game.Players.PlayerRemoving:Connect(function(player)
local success, errormessage = pcall(function()
Ticks:SetAsync(player.UserId.."-ticks", player.leaderstats.Ticks.Value)
end)
if success then
print("Player Data Successfully Saved")
else
print("There was an error while saving data")
warn(errormessage)
end
end)

1 comment
i turned them on before i posted this and it didnt wokr