New to Lua and I can't for the life of me figure out tables.
local Players = game:GetService("Players") local MasterIngamePlayerTable = require(script.Parent.MasterIngamePlayerTable) local PlayerState = require(script.Parent.PlayerState) Players.PlayerAdded:Connect(function(player) MasterIngamePlayerTable[player.Name] = {} print(MasterIngamePlayerTable[player.Name]) MasterIngamePlayerTable[player.Name]["state"] = PlayerState print(game.ServerScriptService.MasterIngamePlayerTable[player.Name]["state"].test) end)
I get the error [player.Name] is not a valid member of ModuleScript. Thanks for any help!
Might be jumping to conclusions here, but the print statement was in the same environment so it was referencing the original tableless state of the module? It worked when I debugged in another script, so I'll just move on with my life.