I've making a project, but i need to get the list of the player's online friends, so i need your help!
✓ ANSWER ACCEPTED
How to use plr:GetFriendsOnline?
1 answer
✓ Accepted answer
GetFriendsOnline is a way to get any player who is online within' someones friendlist, returning an array of found friends.
Like so:
local Player = game.Players.LocalPlayer
local ArrayOfFriends = Player:GetFriendsOnline(1) -- Change this number to how many friends you want, max being 200.
for _,friend in pairs(ArrayOfFriends) do
print(friend.UserName) -- prints friends name
end
5 comments
0
Also, keep in mind. If you leave GetFriendsOnline() empty, without a number. It will by default print 200 friends (or how many friends the player has which are online).
0
Oh, also. You can find the Array Content here: https://developer.roblox.com/en-us/api-reference/function/Player/GetFriendsOnline
0
thanks..
0
the problem was i forgot to add .UserName, thanks
0
No worries.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
plese provide more deatils and follow https://scriptinghelpers.org/help/how-post-good-questions-answers