I have a file called “Data Storage.lua” which is a lua file in which i intended to store data needed by multiple scripts within my program.
local playerHealth = {} -- creates a variable
playerHealth.my_value = 12
return playerHealth -- returns playerHealth to scripts that require
I wanted to add another variable to this to track enemy health, but if I try to do that in the same way as the previous one (I changed my_value to enemy_value cause i thought that would be the correct way to do it)
local enemyHealth = {} -- creates a variable
enemyHealth.enemy_value = 12
return enemyHealth -- returns playerHealth to scripts that require
it spits out this error.