Hello , I had an idea to make an Global Leaderboard for Followers , but I don’t know how to aproach it , My question is how do I get the followers of all players ?
I did some global leaderrboards in the past , but i have no Idea how to get all the followers for everyone in roblox and put it in an board , I don’t even know if this is possible.
You just need to set up a server which, on HTTP request, going to return table of all players in JSON format, sounds like not a big problem perhaps there are way too much people even if we dont count bots, it may be more productive if you take specific player’s folowers, like anyone who joined game going to be included in that leaderboard.
Perhaps there may be a service that already stores top followers and you could use it?
You can use the follower count API to achieve this.
Yes , but how do I store every person from roblox in one table?
I need them all (players) , you know ?
Theoretically. if you got a datacenter of your own you can handle it, although I meantioned that it’s going to be too much players, it’s not even about storing it, it’s just double value per players, I guess there will be not more then 3 TB of space on your disk, it’s about geting actual information . Ofcourse you cant use roblox datastores for it since there is big limits per player and per game
There are billions of users, do you just want to collect the followers of players who have joined your game or every single one?
Could I just take the 50 most followed players and put it on the board?
I thought that myself , so I thought that 50 players on this board with the most followed account to show up , is that normal?
The 50 top players on Roblox or just the top 50 players which have played your game?
on Roblox ? i Think that is what I am going for
So is it possible to make an top 50 Most Followed Persons On Roblox?
local Players = game:GetService("Players")
local DataStores = game:GetService("DataStoreService")
local DataStore = DataStores:GetDataStore("DataStore")
local Http = game:GetService("HttpService")
local ProtectedCall = pcall
local function CreateStats(Player)
local Leaderstats = Instance.new("Folder")
Leaderstats.Name = "leaderstats"
Leaderstats.Parent = Player
local Followers = Instance.new("IntValue")
Followers.Name = "Followers"
Followers.Parent = Leaderstats
return true
end
local function GetFollowers(Player)
local Success, Result = ProtectedCall(function()
return Http:GetAsync("https://friends.roproxy.com/v1/users/"..Player.UserId.."/followers/count")
end)
if Success then
if Result then
local PageData = Http:JSONDecode(Result)
local Followers = PageData["count"]
Player.leaderstats.Followers.Value = Followers
end
else
warn(Result)
end
return true
end
local function LoadData(Player)
local Success, Result = ProtectedCall(function()
return DataStore:GetAsync("Followers_"..Player.UserId)
end)
if Success then
if Result then
Player.leaderstats.Followers.Value = Result
end
else
warn(Result)
end
return true
end
local function SaveData(Player)
local Success, Result = ProtectedCall(function()
return DataStore:SetAsync("Followers_"..Player.UserId)
end)
if Success then
return
else
warn(Result)
end
return true
end
local function OnPlayerAdded(Player)
local _Stats = CreateStats(Player)
repeat
task.wait()
until _Stats
local Data = LoadData(Player)
repeat
task.wait()
until Data
GetFollowers(Player)
end
local function OnPlayerRemoving(Player)
SaveData(Player)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
Players.PlayerRemoving:Connect(OnPlayerRemoving)
This isn’t quite what you asked for (but I was making it anyway), it’s just an in-game followers leaderboard (which uses leaderstats) which gets the follower count of players who join the game and then saves them to a DataStore.
To get the follower count of players that haven’t joined the game you’ll need to change the script slightly.
Thank you for your time , I apreciate you !
Top 75 with most Followers