Метод 1. Использование службы Players
-- Get the Players service
local players = game:GetService("Players")
-- Get the local player
local player = players.LocalPlayer
-- Get the list of online friends
local onlineFriends = {}
for _, friend in ipairs(player:IsFriendsWith()) do
if friend.IsOnline then
table.insert(onlineFriends, friend)
end
end
-- Print the online friends' names
for _, friend in ipairs(onlineFriends) do
print(friend.Name)
end
Метод 2. Использование службы FriendsService
-- Get the FriendsService
local friendsService = game:GetService("FriendsService")
-- Get the list of online friends
local onlineFriends = friendsService:GetFriendsOnline()
-- Print the online friends' names
for _, friend in ipairs(onlineFriends) do
print(friend.Name)
end
Это всего лишь два метода получения списка друзей в Интернете в Roblox Studio. Первый метод использует службу Players и метод IsFriendsWith, а второй метод напрямую использует FriendsService. Вы можете выбрать метод, который лучше всего соответствует вашим потребностям.