Universal Script 📌
1.7k Views
122 Executions

See Who Are Friends in a Server

Universal Script 📌
etherheaded
etherheadedFirst script
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

The script will print a "Friendship List" This will generate a list of users in the server who are friends with each other, provided in the Dev Console. Press F9 to open the Dev Console and view the Friendship List.

View Raw
local Players = game:GetService("Players")

-- 🔧 OPTIONS -----------------------------------------------------
local LOOP_ENABLED = false   -- true = keep printing; false = prints once
local LOOP_INTERVAL = 60     -- seconds between prints if looping
-------------------------------------------------------------------

local function buildFriendshipList()
    local friendshipList = {}
    local playerList = Players:GetPlayers()

    for i = 1, #playerList do
        local p1 = playerList[i]
        friendshipList[p1.Name] = {}

        for j = 1, #playerList do
            if i ~= j then
                local p2 = playerList[j]
                local success, isFriend = pcall(function()
                    return p1:IsFriendsWith(p2.UserId)
                end)
                if success and isFriend then
                    table.insert(friendshipList[p1.Name], p2.Name)
                end
            end
        end
    end

    return friendshipList
end

local function printFriendships()
    local list = buildFriendshipList()
    print("Friendship list:")
    for player, friends in pairs(list) do
        if #friends > 0 then
            print(player .. " is friends with: " .. table.concat(friends, ", "))
        else
            print(player .. " has no friends in the server.")
        end


Comments

3
Log in to join the conversation. Login
romaegriscin's profile picture
romaegriscin1 year ago

Who need it? Spy?

1
supergoonman's profile picture
supergoonman1 year ago

@romaegriscin yes

1
etherheaded's profile picture
etherheadedUploader1 year ago

@romaegriscin to explain, i play a game where people team up a lot, which makes the game unfair for people who aren't teaming. a key strategy is to get rid of teamers, and the most efficient way to spot teamers is to check everyone's friends list so you can see who's friends with who. the purpose of the script is to automatically spot potential teamers so i can strategize around that.

1

Tags

More universal scripts

See all
Universal Script 📌
2.3k
6.9k
Bumped 5 hours ago
Script hub
5.7k
85.5k
Bumped 5 hours ago

Script hub

SAGAZx Hub

Script hub
77.5k
272.9k
Bumped 5 hours ago
Key System
Script hub
506
21
6 hours ago

Script hub

Verified script badgeIridium Hub

Universal Script 📌
1.1M
472.0k
Bumped 8 hours ago
Script hub
5.6k
11.6k
Bumped 9 hours ago

Script hub

swimhub