Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Data Store Tables?

local Data = game:GetService('DataStoreService')

local teleService = game:GetService('TeleportService')

local DataId = Data:GetDataStore('Test8')

local storedData = {}

																						----------------------------------
																						--------| Data Saving Time|-------
																						----------------------------------

																								-- Loading Data.. --

function saveData(player)

DataId:SetAsync(player.UserId, storedData[player])

end

function loadData(player)

return DataId:GetAsync(player.UserId)

end

game.Players.PlayerAdded:connect(function(player)

	local data = loadData(player)

	if not data then

	storedData[player] = {

		Money = 1,

		Level = 2,

		Stability = 3

	}

	saveData(player)

	print("Newbie")

	print(storedData)

else

	storedData[player] = data

	print("BOSS")
	--			

print(game:GetService('DataStoreService'):GetDataStore('Test7'):GetAsync(game.Players.FOG20.Us erId, storedData[1]))

end

Don't know how to reveive that tables without getting a Hexadecimal

1 comment

0

Please put your code in lua block Correctly. Press the blue Lua button then paste all the code inside.

1 answer

That's a table

When you print a table in Lua, it just spits out the memory address. That's fine. Just check to see if it contains the things you needed it to contain instead of checking that it actually exists.

1 comment

0

So add [1] at the end of the table name to index the first entry (or second if lua starts at 0)

This discussion is preserved as it was. New answers, comments, and votes are closed.