I’m currently trying to make an admin panel with a section that displays all the players names, and updates whenever a player leaves/ joins, I’ve never done anything like this before, it’s not throwing an error or anything and I can’t understand why it won’t work.
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(player)
game.ReplicatedStorage.List:FireAllClients(player.Name)
end)
local players = game:GetService("Players")
local repStor = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
repStor.List.OnClientEvent:Connect(function(playerName)
wait(2)
local playerList = player.PlayerGui:WaitForChild("AdminPanel"):WaitForChild("Back"):WaitForChild("PlayerList")
local UIPositions = {
0.026, 0,0.027, 0,
0.026, 0,0.153, 0,
0.026, 0,0.283, 0,
0.026, 0,0.412, 0,
0.026, 0,0.542, 0,
0.026, 0,0.668, 0,
0.026, 0,0.785, 0,
0.026, 0,0.914, 0,
0.39, 0,0.011, 0,
0.39, 0,0.136, 0,
0.39, 0,0.266, 0,
0.39, 0,0.396, 0,
0.39, 0,0.525, 0,
0.39, 0,0.651, 0,
0.39, 0,0.768, 0,
0.39, 0,0.898, 0,
0.763, 0,-0.002, 0,
0.763, 0,0.124, 0,
0.763, 0,0.253, 0,
0.763, 0,0.383, 0,
0.763, 0,0.513, 0,
0.763, 0,0.638, 0,
0.763, 0,0.755, 0,
0.763, 0,0.885, 0
}
local playerSample = repStor.PlayerSample:Clone()
playerSample.Parent = player.PlayerGui.AdminPanel.Back.PlayerList
playerSample.Text = playerName
playerSample.Position = UDim2.new(UIPositions[#game.Players:GetChildren()])
playerSample.Visible = true
end)