How do I get the information from this table? http://wiki.roblox.com/index.php?title=API:Class/Player/GetFriendsOnline . I just want to be able to access the player's friend's VisitorId, Last Online, IsOnline, LastLocation, and PlaceId.
✓ ANSWER ACCEPTED
How do I use GetFriendsOnline()?
1 answer
✓ Accepted answer
GetFriendsOnline() returns a array, or a table if you say of the player specified friends.
In this example, I'm just going to print out each online friend's VisitorId, PlaceId, and LocationType.
**LocalScript in StarterPlayerScripts: **
local plr = game.Players.LocalPlayer
for i,v in pairs (plr:GetFriendsOnline()) do
print(" ") -- New Line (Making it look pretty in Output)
if v.VisitorId then
print("Friend #"..i, " id is "..v.VisitorId) -- Get their userId
end
if v.PlaceId then
print(" Last Place Visited Was: "..v.PlaceId) -- Get the place id of the game they're playing.
end
if v.LocationType == 0 then -- Checking location type
print(" Is on mobile website")
elseif v.LocationType == 1 then
print(" Is in mobile game")
elseif v.LocationType == 2 then
print(" Is on website")
elseif v.LocationType == 3 then
print(" Is in studio")
elseif v.LocationType == 4 then
print(" Is ingame")
end
end
You should get the basic concept on how it works. Test this, and configure it, and you should get what you need.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thank, you so much!
How can I find the JobId with this?