Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I use :GetFriendsOnline()?

Asked by 8 years ago

Any one know how to use this. I know it needs to be called locally and it returns something along the lines of "table: 1D163E88". Can someone give a example of how I would print out each value?

2 answers

Log in to vote
1
Answered by
Kurieita 125
8 years ago
local Friends = Game.Players.LocalPlayer:GetFriendsOnline()
print(unpack(Friends))

Upvote please

Ad
Log in to vote
0
Answered by 8 years ago

GetFriendsOnline

:GetFriendsOnline() returns a table. so well... yeah. It returns a table of all friends that are online. so, if we want to know each player in the table then we will define it first, and use a pairs loop on that table to print each value on it.

local friends = game.Players.LocalPlayer:GetFriendsOnline()

for _,v in pairs (friends) do
    print(v)
end

Answer this question