I’m currently making a real-time cross-server teleport with friends however I’m having an issue where Friend.PlaceId is returning nil on the Roblox Website version of Roblox.
As you can see in the video below I have the Microsoft version of Roblox running and the Roblox version of Roblox running. The Microsoft version shows that the player is playing but the Roblox version is not showing.
This is not an issue with my script but rather the function GetFriendsOnline is unreliable. The script is below.
function UpdateFriendsServer()
local OnlineFriends = Player:GetFriendsOnline()
local Servers, PrivateServerId = RF:InvokeServer("RetrieveServerList")
local PlayingFriends = {}
if PrivateServerId ~= "" then
Servers[PrivateServerId] = nil
end
for _, Friend in ipairs(OnlineFriends) do
if Friend.IsOnline then
if Friend.LocationType == 1 or Friend.LocationType == 4 then
if Friend.PlaceId == 9575192366 then
PlayingFriends[Players:GetUserIdFromNameAsync(Friend.UserName)] = Friend.GameId
end
end
end
end
for _, Frame in ipairs(Frames[1].BottomFrame.Friends:GetChildren()) do
if Frame:IsA("TextButton") and Frame.Name ~= "Template" then
Frame:Destroy()
end
end
for Friend, JobId in pairs(PlayingFriends) do
for ServerId, Data in pairs(Servers) do
if Data.JobId == JobId then
local Template = Frames[1].BottomFrame.Friends.Template:Clone()
Template.Name = Data.Server_Name
Template.ServerName.Text = Data.Server_Display_Name
Template.PlayerName.Text = Players:GetNameFromUserIdAsync(Friend)
Template.Player.Image = "rbxthumb://type=AvatarHeadShot&id="..Friend.."&w=150&h=150"
Template.PlayersAmount.Text = Data.Player_Joined
Template.LikeRatio.Text = Data.Like_Ratio
Template.Visible = true
Template.Parent = Frames[1].BottomFrame.Friends
Template.Play.MouseButton1Click:Connect(function()
HideFrame()
ShowFrame("PromptFrame")
Connections["Confirm"] = Frames[6].Confirm.MouseButton1Click:Connect(function()
RE:FireServer("JoinServer", ServerId)
Disconnect()
end)
Connections["Cancel"] = Frames[6].Cancel.MouseButton1Click:Connect(function()
HideFrame()
ShowButtons()
Disconnect()
end)
end)
break
end
end
end
end
What alternative should I use?