Hello, I’m scripting a custom playerlist and I’d like to hide teams which have no players in it. Problem is I don’t understand how to code it: I can’t find a way to link the frame and the actual team.
I’ve searched around for a solution but can’t find any, if someone could help it would be amazing, thank you in advance.
Here’s some code and photos:
(NonInUsoTeam is the folder in ReplicatedStorage where I want the frames to be stored)
if #team:GetPlayers() == 0 then
local frames = listaplayer:GetChildren()
if frames.Name == team.Name and #team:GetPlayers() == 0 then
frames.Parent = game.ReplicatedStorage.NonInUsoTeams
end
end
This if is in a for loop, I’ve tried with a print and it prints the number of the teams with players missing.
listaplayer is the ScrollingFrame where all the frames are.
(local listaplayer = script.Parent.Frame.ScrollingFrame)
GUI: https://gyazo.com/033e4c8e17bb0802251f868d235380c1
(The local script in it is a Canvas Size thing of the scrolling frame, nothing to do with the actual script)
The name of the frames are equivalent to the names of the teams in the Teams Service.
If you need the entire block of code, let me know.