G’day. Basically, using the table.insert() doesn’t work even when doing something like: Clients[plr] = true, it doesn’t work. It prints out: {}. Also, when adding a print to the playerAdded it works therefore there is no problem with these at all except the table.
function MoneyService:ServerStart()
local Clients = {}
local function addPlayer(plr)
if not table.find(Clients, plr) then
table.insert(Clients, plr)
end
end
local function removePlayer(plr)
local index = table.find(Clients, plr)
if index then
table.remove(Clients, index)
end
end
for _, player in ipairs(Players:GetPlayers()) do
addPlayer(player)
end
Players.PlayerAdded:Connect(addPlayer)
Players.PlayerRemoving:Connect(removePlayer)
print(Clients)
for _, client in ipairs(Clients) do
if client:IsA("Player") then
MoneyService.ServerStartFunc.Client[client.Name] = MoneyService.ServerStartFunc.Client[client.Name] or {}
MoneyService.ServerStartFunc.Client[client.Name]["Print"] = MoneyService.Client.Print
MoneyService.ServerStartFunc.Client[client.Name]["SayNothing"] = MoneyService.Client.SayNothing
end
end
print("Server started!")
end
Please I really need help, thanks.