Attempt to index nil with player name, _G

hey so i am trying to store some tables in _G, but i am getting this error:


TFlanigan is my nickname ofc
here is the line

_G.Layouts[plr.Name][slot] = structuretable

if you’d like more of the code let me know

Make sure _G.Layouts is defined as a table first.

well it should
unless im doing something wrong
image

Did you ever do

_G.Layouts = {}

Somewhere before the PlayerAdded?

Also I don’t see you make a table in layouts for the player so that will error as well, somewhere in the PlayerAdded, include

_G.Layouts[plr.Name] = {}

oh okay let me try that, ill reply if that works

1 Like

yeah that works, thanks for the help!

1 Like