server side
--first function
local jogsA = jogadores:GetChildren()
local jogsF = {}
for i = 1, #jogsA do
jogsF[i] = game:GetService("Players"):GetPlayerByUserId(jogsA[i].Name).Name
end
ATUALIZARJOGADORES:FireClient(player, jogsF, 1)
--second function
local jogs = game:GetService("ServerStorage").Salas:FindFirstChild(sala).jogadores
local jogsA = jogs:GetChildren()
local jogsF = {}
for i = 1, #jogsA do
jogsF[i] = game:GetService("Players"):GetPlayerByUserId(jogsA[i].Name).Name
end
for i = 1, #jogsA do
local jog = game:GetService("Players"):GetPlayerByUserId(tonumber(jogsA[i].Name))
if jogsA[i].Name == tostring(host) then
ATUALIZARJOGADORES:FireClient(jog, jogsF, 1)
else
ATUALIZARJOGADORES:FireClient(jog, jogsF, 0)
end
end
client side
ATUALIZARJOGADORES.OnClientEvent:Connect(function(jogs, aux)
local P
local Pc
local frameM = game:GetService("Players").LocalPlayer.PlayerGui.Main.Frame
if aux == 1 then
P = frameM.P5.Frame
elseif aux == 0 then
P = frameM.P6.Frame
end
Pc = P:GetChildren()
for i = 1, #Pc do
if not Pc[i]:IsA("UIListLayout") and Pc[i].Name ~= "Placeholder" then
Pc[i].Visible = false
Pc[i]:Destroy()
end
end
print(jogs)
print("print 1")
for i = 1, #jogs do
print("print 2")
local jog = P.Placeholder:Clone()
jog.Text = jogs[i]
jog.Name = tostring(i)
jog.Visible = true
jog.Parent = P
end
end)
when the event is fired by the first function, everything works, when its fired by the second function, not everything works, the table printed is empty, the "print 1" is printed but "print 2" isnt, i have no idea at how the table is being empty when fired by the second function (the whole script isnt written down, feel free to ask for more information if u need)
** You are now Level 4! **