My local players
table uses the PlayerServerId as Index.
When i now want to access the player data at Index 1 (My PlayerServerId) i get nil
as a result.
But when i now iterate through the players table and print out the index for the iterations, I get the Index 1 (like how i expect)
Debug Code:
print("PlayerServerId: ".. GetPlayerServerId(PlayerId())) -- --> Output: "PlayerServerId: 1"
print(players[1]) -- --> Output "nil"
for i, player in pairs(players) do
print("Index: " .. i) -- --> Output: "Index: 1"
end
Output:
image of output
How is this possible? What am i doing wrong or what do I oversee?
I tried to debug every single step to make sure the data i want to access is available.