i want to save colours for multiple houses and each house has multiple houses how would i save them? i know how to save them the long way so like
--when player leaves-- local colourdatastore =game:GetService("DataStoreService"):GetDataStore("Colour") colourdatastore:SetAsync(player.UserId..":wallcolour:") --when player enters-- local getwallcolour= colourdatastore:GetAsync(player.userId..":WallColour") if wallcolour == nil then wallcolour.Value = Brickcolor.new("Black") else wallcolour.Value = getwallcolour end
iis there a easier way to save them? because the way i know will take a long time and alot of space, anything will be great TY.
Hopefully this is more or less what you were looking for, the way I structured it you'd either have to make the strings here or child them in a folder and clone them into the player.
local colourdatastore =game:GetService("DataStoreService"):GetDataStore("Colour") function savefiles(player) local SaveTable = { wallcolor1 = player.House1.wallcolor1.Value, wallcolor2 = player.House1.wallcolor2.Value, wallcolor3 = player.House1.wallcolor3.Value, wallcolor4 = player.House1.wallcolor4.Value } return SaveTable end local save = savefiles(player) local H1 = player.House1 local saved = colourdatastore:GetAsync(player.userId) game.Players.PlayerAdded:Connect(function(player)--load players info function loadsave(player, save) H1.wallcolor1.Value = saved.wallcolor1 H1.wallcolor2.Value = saved.wallcolor2 H1.wallcolor3.Value = saved.wallcolor3 H1.wallcolor4.Value = saved.wallcolor4 end function pullthedata() --this is where you'll need to make something to grab the color values from the strings and convert the brick color into corresponding color end end) function savefunc(player) colourdatastore:SetAsync(player.userId,save) end game.Players.PlayerRemoving:Connect(savefunc)--save players info on d/c