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.
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.