You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Data save a table of (Players) inventory for each player -
What is the issue? Include screenshots / videos if possible!
Trouble on making a table that will act as each player inventory in the data save script -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried using a object like I always use. But I realize there isn’t a object for tables
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local CurrencyGold = Instance.new("NumberValue")
CurrencyGold.Name = "Gold"
CurrencyGold.Parent = Plr
local CurrencyAether = Instance.new("NumberValue")
CurrencyAether.Name = "Aether"
CurrencyAether.Parent = Plr
local PlayerTowerOwn = {}
local PlayerTowersEquipped = {}
local PlrKey = "Data_"..Plr.UserId
local Data
local Success, Failed = pcall(function()
Data = DataStore:GetAsync(PlrKey)
end)
if Failed then
error(Failed)
end
if Data then
CurrencyGold.Value = Data[1]
CurrencyAether.Value = Data[2]
PlayerTowerOwn = Data[3]
PlayerTowersEquipped = Data[4]
else
CurrencyGold.Value = 500
table.insert(PlayerTowerOwn, "Scout")
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.