Getting an user current status

In some game i saw some menu that showed your friends current status, what they were playing, if they were online,etc.

Im searching on how to do this but i cant find information, so im trying to get an user or player current status.

Example:
d63f8dd708011a66a7d420255cabdefc

2 Likes

The method Player:GetFriendsOnline() can be used to get info on your online friends their statuses

Example usage:

local localPlayer = game:GetService("Players").LocalPlayer

for _, friendData in next, localPlayer:GetFriendsOnline() do
	print(string.format("friend %s is playing: %s", friendData["UserName"], friendData["LastLocation"]))
end
2 Likes

Could i do this with a specific user?

1 Like

Yeah but they have to be a friend of the LocalPlayer.

local localPlayer = game:GetService("Players").LocalPlayer
for _, friendData in next, localPlayer:GetFriendsOnline() do
    if friendData.UserName == "PLAYER_NAME" then
	    print(string.format("friend %s is playing: %s", 
        friendData["UserName"], friendData["LastLocation"]))
    end
end