I’m creating a script in the player that requests data to the server, and the server sends tables, i’m currently working with this example:
local St = {["GoodPerson"] = {
[29999999999] = {
["A"] = 1;
["B"] = 1;
};
[1] = {
["A"] = 1;
["B"] = 1;
};
[3] = {
["A"] = 1;
["B"] = 1;
};
[2] = {
["A"] = 1;
["B"] = 1;
};
};
}
So, 29999999999, 1, 3 and 2 are the tables that are going to be printed, and now the problem is that this is not being printed as expected:
1
2
3
For any reason, this is printing in a numerical order, and numbers that are skipping other numbers, like 1 and 3, 3 is not being printed. I find very strange, here is the LocalScript:
local RepStorage = game:GetService("ReplicatedStorage")
local GetSD = RepStorage:FindFirstChild("GetShopData")
print("Getting a table...")
wait(5)
local newPart = GetSD:InvokeServer()
local Stu = unpack(newPart)
for Yes, Table in pairs(Stu) do
print(Yes)
for TableName, a in pairs(Table) do
print(TableName)
end
end
And here is the ServerScript:
local RepStorage = game:GetService("ReplicatedStorage")
local GetSD = RepStorage:FindFirstChild("GetShopData")
local Error = 0
local St = {["GoodPerson"] = {
[29999999999] = {
["A"] = 1;
["B"] = 1;
};
[1] = {
["A"] = 1;
["B"] = 1;
};
[3] = {
["A"] = 1;
["B"] = 1;
};
[2] = {
["A"] = 1;
["B"] = 1;
};
};
}
local function Boomer(Player)
local PackedST = table.pack(St)
return PackedST
end
GetSD.OnServerInvoke = Boomer
I searched in the developer hub for some solutions, but i didn’t find something useful. Thanks for reading.