Expected identifier when parsing expression, got '='

So For My game I want to add new things to a table, but to get the table I have to get a datastore, Im guessing it has something to do with the data store

	local GeoCache = GeoCacheData:GetAsync('GeoCache-'..GeoID) or {} -- Table DataStore
	local newtable = GeoCache[#GeoCache+1] = {plr.UserId, Message} -- Error here at the second '='
GeoCache:SetAsync('GeoCache-'..GeoID, newtable)

can someone explain how table datastores work to me and what Im doing wrong. Thanks!

If you are making a variable,you can’t use another ‘=’

1 Like

Same thing happends if I Put it into the set async by itself

GeoCache:SetAsync('GeoCache-'..GeoID, GeoCache[#GeoCache+1] = {plr.UserId, Message})

You can’t also put ‘=’ to set variables in parameters

hm, is there any way I could make this work?

local GeoCache = GeoCacheData:GetAsync('GeoCache-'..GeoID) or {} -- Table DataStore
table.insert(GeoCache,{plr.UserId, Message} )
GeoCache:SetAsync('GeoCache-'..GeoID, GeoCache[#GeoCache])