I'm trying to create a player list, which it is working but only showing the client in the list. I'm using the FireAllClients() event which I think is supposed to fire all of the clients in the game(correct me if i'm wrong). It doesn't seem to be working though. Any help? Here is the script.
---Server Script
---Server side events
game:GetService("Players").PlayerAdded:Connect(function(p)
game.ReplicatedStorage.Events.AddPlayerToVotingList:FireAllClients()
end)
---
game:GetService("Players").PlayerRemoving:Connect(function(p)
game.ReplicatedStorage.Events.RemovePlayerFromVotingList:FireAllClients()
end)
---Local Script
---Wait for game to load
wait()
---Variables
local playerservice = game:GetService("Players")
local players = playerservice:GetPlayers()
local frame = script.Parent.ScrollingFrame
local temp = frame.Template
local player_table = {}
---Functions
function AddPlayer()
print("Player added!")
for i = 1,#players do
if players[i] then
if not player_table[players[i].Name] then
table.insert(player_table,players[i])
temp.Name = players[1].Name
temp.Text = players[1].Name
if i > 1 then
local tempclone = temp:Clone()
tempclone.Name = players[i].Name
tempclone.Text = tempclone.Name
return tempclone
end
end
end
end
end
---
function RemovePlayer(player)
print("Player removing!")
for i = 1,#player_table do
if player_table[i] then
table.remove(player_table,player_table[i].Name)
local temp = AddPlayer()
if temp then
temp:Destroy()
end
end
end
end
---Events
game.ReplicatedStorage.Events.RemovePlayerFromVotingList.OnClientEvent:Connect(RemovePlayer)
---
game.ReplicatedStorage.Events.AddPlayerToVotingList.OnClientEvent:Connect(AddPlayer)

3 comments
What do you mean only showing "the client" in the list?
Let me guess here: a GUI is client-based. So you mean that the GUI only shows the list of players as the current player viewing the gui. For example if I were connected it shows "legoguy939" as the only player even though there are other players connected?
Yes, that's exactly what i mean't