Is it possible to make a list of teams which was a player?

Can I try and make a list of players in the team who are currently in the game and find out their nicknames?

6 Likes

I dont get what you mean by team. Could you clarify?

1 Like

In a certain team, for example “Citizens”, and if there is a player in it, then the frame with the name of the player is cloned

1 Like

Use Team:GetPlayers() to get all the players
for each player use player.DisplayName for their display name
hope this helps!

I am thinking of doing this but the frame is not cloned, the script is below:

local Teams = game:GetService("Teams"):FindFirstChild("Citizens")

local function update()
	for i, team in pairs(Teams:GetPlayers()) do
		if #team > 0 then
			local findplr = script.CloneFrame:Clone()
			findplr.TextName.Text = Teams:GetPlayers()
			print(string.format("There are players on the %s team.",team.Name))
		end
	end
end
3 Likes

Not exactly sure what you’re trying to do but try changing

findplr.TextName.Text = Teams:GetPlayers()

into

findplr.TextName.Text = team.Name

As :GetPlayers() returns an array of players, which means team is a player.

1 Like

I changed what you wrote to this, but it still does not clone, and there are no errors in the output

2 Likes

I just read it again and I think you’re forgetting to parent the cloned frame.

findplr.Parent = yourdesiredpathhere
2 Likes

I have this frame in a local script and this script above is written there, I did as you said, but the frame is still not cloned or how do i make Parent when the frame is in local script or should i leave as you did above?

2 Likes

You have to parent the frame to wherever it’ll show. Like a ScreenGui for the player you want.

My screenGui name - “Stats” - “PlayerStats” - MainFrame - LocalScript - CloneFrame - TextName

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.