how can execute the local data part perfect for the async part without getting the error "attempt to concatenate string with nil "
local planetdata = game:GetService("DataStoreService"):GetDataStore("PlanetData")
local PlanetList,Planets,PlanetNames,GravityList = MainModule.PlanetList()
local RaceStats = MainModule.GetRaceStats()
local data = planetdata:GetAsync("test")
if not data then
planetdata:SetAsync("test", {RaceStats[Stats.Race.Value]['Home Planet']..PlanetList[Planets]})
wait(3)
That is causing the error unless you sent the wrong one.
Follow the steps above to solve your problem. Based on what you said, it sounds like your saved data is lacking an entry. Print out the data, find which part is missing, and check where that should have been added.