Hi, I’m having problems with the new Ban API that came out recently. Whenever I try and acquire someone’s ban history in studio it results in HTTP 403: Forbidden, rather than the actual ban history. How can I fix this?
Here is the code (It’s one line):
print(game.Players:GetBanHistoryAsync(1787100815))
Here is the error I’m receiving:
2 Likes
I am not 100% on scripting myself, especially with the ban API however. Going through what code you have given, two things I would say;
Make sure its in a server script
Async
will need to be wrapped in a pcall
as they are asynchronous network requests that can fail.
Overall, if your still struggling. I would suggest reading through this as this works. Should give you a better mind your dealing with.
I’m using the new Ban API’s GetBanHistoryAsync() function to retrieve a player’s ban history. This is for a friend’s game, which has a custom made admin panel system built by me. However, GetBanHistoryAsync() is always returning nil, even after trying to convert the ID to a number.
Code (Server):
remotes:WaitForChild("getBanHistory").OnServerInvoke = function(player, id)
id = tonumber(id)
print("Loading ban history for ID: "..id)
local success, banHistory = pcall(function()
return game.Pl…