I’ve got an admin panel that I’m trying to add a player list to. But for some reason, it doesn’t work. Local script is shown below. All help is appreciated!
local template = game.ReplicatedStorage.AdminPanel.Template
function updatePlayers()
for i, child in pairs(script.Parent.Holder:GetChildren()) do
if child:IsA("TextButton") then child:Destroy() end
end
for i, plr in pairs(game.Players:GetPlayers()) do
local templateClone = template:Clone()
templateClone.Text = plr.Name
end
end
updatePlayers()
game.Players.PlayerAdded:Connect(updatePlayers)
game.Players.PlayerRemoving:Connect(updatePlayers)