I need to get all the players friends and I have no idea how! I need only the friends that are online playing the game at that moment. Please someone help! I need this so if they want they can transfer to the same team
local Player = game:GetService('Players').LocalPlayer -- Get the Player local PlayersFriends = Player:GetOnlineFriends() -- This is how.
But in your case, since you need to allow them to transfer to the same team, you would need this.
local Players = game:GetService(Players) local PlayersinPlayers = Players:GetPlayers() -- get the players local AbleTeams = {} for i, v in pairs(PlayersinPlayers) do -- and an example of how you can do it if v ~= Players.LocalPlayer and Players.LocalPlayer:IsFreindsWith(v.UserId) then table.insert(AbleTeams, v.Team) end end --i think you can do it from here