How to insert a number into a _G table

Accidentally deleted my last post.
I’m making a game that requires having numbers inserted into a G_Table for everything.

_G.TEST = table.create(0) and this seems to work fine, until I try doing table.insert(_G.TEST, 10)

not sure but maybe the table is limited to the number you pass to table.create(), try just making a table normally and see if that works.

_G.Test = {} -- public state is in PascalCase, UPPER_SNAKE_CASE is reserved for constants

table.insert(_G.Test,10)

print(_G.Test) --> [array]
1 Like

Your original code worked just fine for me

I must’ve implemented something wrong then.