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

HTTP 403 [Forbidden] I don't know what this means, but it's an error causing my script not to work?

So my friend wants me to make a suggestion board for her group and it basically allows players to type in suggestions for clothes in her group and it adds it to the board and saves it as a global variable so when my friend enters the game she can read the suggestion and write it down. However, once I test it, type in a suggestion, and click confirm, it pops up with this error.

If you know what is going on, please let me know. (Also I've never done a global leaderboard or OrderedDataStore before so I followed the tutorial by TheDevKing and I'm not sure if it can save sentences instead of numbers, but I tried to do it anyway. If there is a different way I should be doing this, please let me know.)

Here is the code

local DataStoreService = game:GetService("DataStoreService")
local suggLeaderboard = DataStoreService:GetOrderedDataStore("suggLeaderboard")
local remote = game:GetService("ReplicatedStorage"):WaitForChild("SuggestionEvent")

remote.OnServerEvent:Connect(function(player, suggestion)
		local success, errormessage = pcall(function()
		local Data  = suggLeaderboard:GetSortedAsync(false, 5)
		local suggPage = Data:GetCurrentPage()
		for rank,Data in ipairs(suggPage)do
			local username = game.Players:GetNameFromUserIdAsync(tonumber(Data.key))
			local Name =  username
			local sugg = Data.Value
			local isonleaderboard = false
			for i, v in pairs(game.Workspace.GlobalLeaderboard.LeaderboardGUI.Holder:GetChildren())do
				if v.Name.Text then
					isonleaderboard = true
				end
			end
			if sugg and isonleaderboard == false then
				local newLbFrame = game.ReplicatedStorage:WaitForChild("leaderboardFrame"):Clone()
				newLbFrame.Name.Text = Name
				newLbFrame.Suggestion.Text = suggestion
				newLbFrame.Position = UDim2.new(0, 0, newLbFrame.Position.Y.Scale + (0.08 * #game.Workspace.GlobalLeaderboard.LeaderboardGUI.Holder:GetChildren()), 0)
				newLbFrame.Parent = game.Workspace.GlobalLeaderboard.LeaderboardGUI.Holder
			end
		end			
	end)
	
	if not success then
		print(errormessage)
	end
end)

5 comments

0

It means you don't have permission to access the DataStore API due to inferior credentials. It can only be acess by the primary owner of the place (including TC sessions); the script must be sanctioned by this user. It's also Data.value*

0

As @Feahren said you cannot use datastores if you're not the owner of the place. I've already answered this question here https://scriptinghelpers.org/questions/104514/please-help-145039242-502-api-services-rejected-request-with-error-http-403-forbidden#96457

0

I am owner of this place and Team Create is not enabled. I guess I can try changing Data.Value to Data.value as Feahren said, and I'll see what happens.

0

K, the error is gone, but now it isn't doing anything? I'm not sure what the deal is.

1 answer

Hey, BreckleShrimp

This might be because you haven't enabled Studio API Settings as well as HTTP Service. To do that, you are gonna wanna go to HOME > Game Settings > Setting and then enable both services. If you are not quite sure what I am talking about, here is a link to a wiki page that might explain it in more detail for you. I hope this helps.

https://developer.roblox.com/en-us/articles/game-settings

1 comment

0

Thank you for the quick reply! Unfortunately, that isn't my problem. Both API Services and HTTP requests are in fact enabled.

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