Datastore error

local DataStoreService = game:GetService("DataStoreService")
local WorkerPointsStore = DataStoreService:GetDataStore("WorkerPoints")
local ActivityPointsStore = DataStoreService:GetDataStore("ActivityPoints")
local groupId = 5774015
game.Players.PlayerAdded:Connect(function(player)
	local leaderstats = Instance.new("Folder",player)
	leaderstats.Name = "leaderstats"
	
	local rank = Instance.new("StringValue",leaderstats)
	rank.Name = "Group Rank"
	rank.Value = player:GetRoleInGroup(groupId)
	
	local workerPoints = Instance.new("IntValue",leaderstats)
	workerPoints.Name = "Worker Points"
	workerPoints.Value = WorkerPointsStore:GetAsync(player.UserId) or 0
	
	local activityPoints = Instance.new("IntValue",leaderstats)
	activityPoints.Name = "Activity"
	activityPoints.Value = ActivityPointsStore:GetAsync(player.UserId) or 0
	
	player.NameDisplayDistance = 0
	while wait(60) do
		player.leaderstats["Activity"].Value = player.leaderstats["Activity"].Value + 1
	end

	
end)

[18:28:22.821 - 502: API Services rejected request with error. HTTP 403 (Forbidden)]
18:29:49.866 - HTTP 403 (Forbidden) (x3) - From another script

1 Like

Did you enable Roblox Studio’s access to API services?

If not, you can do so by going to Game Settings > Security and checking the appropriate box.

2 Likes

Im so embarrased, someone turned them off and I didnt realize lmaoo

1 Like