Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

DataStore2 Error: HTTP 403 (Forbidden) [?]

Hello there!

I followed a tutorial by AlvinBlox about DataStore2. I tryed it out myself of course. But I have an issue with it. I have this error printing multiple times in the output that says:

HTTP 403 (Forbidden)

Here is the script I made in ServerScriptService:

local dataStore2 = require(game.ServerScriptService.MainModule)

local defaultValue = 0

game.Players.PlayerAdded:Connect(function(plr)
	
	local cashDataStore = dataStore2("Cash", plr)
	
	local leaderstats = Instance.new("Folder", plr)
	leaderstats.Name = "leaderstats"
	
	local Cash = Instance.new("IntValue", leaderstats)
	Cash.Name = "Cash"
	
	local function cashUpdate(updatedValue)
		
		Cash.Value = cashDataStore:Get(updatedValue)
		
	end
	
	cashUpdate(defaultValue)
	
	cashDataStore:OnUpdate(cashUpdate)
end)

game.Workspace:WaitForChild("Part"):FindFirstChild("ClickDetector").MouseClick:Connect(function(player)
	
	local cashDataStore = dataStore2("Cash", player)
	
	cashDataStore:Increment(50,defaultValue)
	
end)

Any help will be much appreciated, Have a fantastic day!

1 comment

0

Can you... accept my answer?

1 answer

✓ Accepted answer

Datastore service cannot be used in studio The HTTP error code 403 means that the required recourse is forbidden, I am not fully aware of why this happens. There is not way to get past this but enabling studios access to API is a great start, and I assume it will get rid of your error.

Links:

HTTP 403,

DATASTORE ERRORS (see 403)

1 comment

0

Oh thanks, i forgot about that

This discussion is preserved as it was. New answers, comments, and votes are closed.