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

[Solved] How would I store configurations using datastore?

So I am making a game where players make their own suit & can eventually build plating on it. But I am having trouble coming up with a way to store the player's 'plating configuration' since each plate has to have a 'vector 3' sort of value as well as which part it is attached to & what material it is. how would I store these five different values easily in a table & then store it with datastore?

here is some code I was experimenting with but I am still having trouble:

local DSS = game:GetService("DataStoreService")
local PltngConfig = DSS:GetDataStore("PlatingConfig")

game.Players.PlayerAdded:connect(function(player)
	if PltngConfig:GetAsync(player.userid) ~= nil then
		PlatingConfig = PltngConfig:GetAsync(player.userid)
	else
		--code to make new data will go here
	end
end)


game.Players.PlayerRemoving:connect(function(player)
	PltngConfig:SetAsync(player.userid, PlatingConfig)
	
end)

1 answer

Nvm, I just found out how to make tables within tables which allows me to save 5 values per key.

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