Roblox Avatar Changer (coming soon)

public
vxpreen Jul 28, 2024 Never 64
Clone
Lua paste1.txt 35 lines (30 loc) | 1.05 KB
1
-- loadstring(game:HttpGet("https://pastecode.dev/raw/ef32lha4/paste1.txt"))()
2
3
local Players = game:GetService("Players")
4
5
local USERNAME = "XiDuxrentusxX"
6
7
local function iterPageItems(pages)
8
return coroutine.wrap(function()
9
local pagenum = 1
10
while true do
11
for _, item in ipairs(pages:GetCurrentPage()) do
12
coroutine.yield(item, pagenum)
13
end
14
if pages.IsFinished then
15
break
16
end
17
pages:AdvanceToNextPageAsync()
18
pagenum = pagenum + 1
19
end
20
end)
21
end
22
23
-- First, get the user ID of the player
24
local userId = Players:GetUserIdFromNameAsync(USERNAME)
25
-- Then, get a FriendPages object for their friends
26
local friendPages = Players:GetFriendsAsync(userId)
27
-- Iterate over the items in the pages. For FriendPages, these
28
-- are tables of information about the friend, including Username.
29
-- Collect each username in a table
30
local usernames = {}
31
for item, _pageNo in iterPageItems(friendPages) do
32
table.insert(usernames, item.Username)
33
end
34
35
print("Friends of " .. USERNAME .. ": " .. table.concat(usernames, ", "))