Friend.PlaceId always nil?

I’m trying to make a follow a friend gui for games in my universe. I’m not getting anything for the friend’s PlaceId. I wrote this in a test place with no other scripts but friend.PlaceId is still nil even when my friend is in a game. Is there some reason this code isn’t working?

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local FriendsOnline = LocalPlayer:GetFriendsOnline()

for _, friend in pairs(FriendsOnline) do
	for i, v in pairs(friend) do
		print(tostring(i)..tostring(v))
	end
	if friend.LocationType == 4 then -- friend is in game
		print(friend.PlaceId)
	end	
end

Output:

As per the documentation, “some fields are only present for certain location types.” As you can see the GameId is not also printed for the same unidentified reason.

If you try the script with another player, it might work and find the PlaceId and GameId.

Yes I saw that but I had assumed if a player was in a game the PlaceId would be there. If that’s not the case how could I get the PlaceId of the player so I can show relevant results in the gui?

I found what I was doing wrong. PlaceId doesn’t work if the place is private.

Who said that? Just wondering.

I couldn’t find it stated anywhere. But when I tested it ingame friend.PlaceId was not equal to nil only when my friend was in a non private game.