Script to find all badges a player has ever recieved

  1. What do you want to achieve? Keep it simple and clear!
    Im trying to create a script that will list me a table that has all the badges a player has ever recieved, then I want to see when the badges were awarded to that player

  2. What is the issue? Include screenshots / videos if possible!
    I have no clue on what I’m doing, I’ve found the API Docs and how to use a proxy but Im stuck with using nextCursor when there’s alot of badges

I’m using this code at the moment but don’t know how to proceed with it

local HttpService = game:GetService("HttpService");
local remote = game.ReplicatedStorage.Badges
remote.OnServerInvoke = function(plr, UserId)
	local followers = {};
	local url = ("https://badges.roproxy.com/v1/users/672360774/badges?limit=100&sortOrder=Desc"):format(tostring(UserId))
	local success, output = pcall(function() return HttpService:JSONDecode(HttpService:GetAsync(url)) end);
	if not (success) then
		return followers;
	end
	for _, v in pairs(output.data) do
		table.insert(followers, {
			name = v.name;
			displayName = v.displayName;
			userId = v.id;
		});
	end
	return followers;
end 
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried to use the script I have but it only gives this in studio
1 Like

Can you post the actual error and not the stack trace?

1 Like


This is what I’m getting

1 Like

That error means that a RemoteFunction named Badges wasn’t found inside of ReplicatedStorage. Make sure you haven’t accidentally named it incorrectly

1 Like

Hello fellow. It seems to you forgot to add the remote function event itself into the selected location, and just to be informed. Do you know how to invoke it or else: Here’s a snip-snip of the code’s snapshot projected inside my inner mind,

local plr = game.Players.LocalPlayer
local getBadges = game.ReplicatedStorage.Badges:InvokeServer(plr.UserId)
if getBadges then – This checks if the recieved data is valid

end

By the way you gotta add a localscript. :evergreen_tree:

1 Like