How to save trails?

is this a good way to save trails?

local Players = game:GetService("Players")
local DataStore = game:GetService("DataStoreService"):GetDataStore("StatsDataStore")
local ServerStorage = game:GetService("ServerStorage")

Players.PlayerAdded:Connect(function(player)

	local PlayerTrails = Instance.new("Folder",player)
	PlayerTrails.Name = "PlayerTrails"

	local TrailsFile = ServerStorage:WaitForChild("Trails")
	
	-- load saved data
	local data

	local success, ErrorMsg = pcall(function()
		data = DataStore:GetAsync("player_"..player.UserId)
	end)

	if success and data then
		
		-- load trails
		for _, trail in pairs(TrailsFile:GetChildren()) do
			for _, TrailName in pairs(data.trails) do
				if trail.Name == TrailName then
					local TrailClone = trail:Clone()
					TrailClone.Parent = PlayerTrails
					print(trail.Name)
				end
			end
		end
	else
		print("there was an error while loading player data")
		warn(ErrorMsg)
	end
	
	local PlayerGui = player:WaitForChild("PlayerGui")
	local ScrollingFrame = PlayerGui:WaitForChild("TrailsGui"):WaitForChild("TrailsFrame"):WaitForChild("ScrollingFrame")

	for _,trail in pairs(PlayerTrails:GetChildren()) do
		for _, TrailImage in pairs(ScrollingFrame:GetChildren()) do
			if TrailImage:IsA("ImageLabel") and TrailImage.Name == trail.Name then
				TrailImage.EquipButton.Text = "Equip"
				TrailImage.PriceText.Visible = false
			end
		end
	end
end)

Players.PlayerRemoving:Connect(function(player)
	
	local Money = player.leaderstats.Money
	local Wins = player.leaderstats.Wins
	local PlayerTrails = player:WaitForChild("PlayerTrails")
	
	local data
	data.trails = data.trails or {}
	
	if #PlayerTrails:GetChildren() > 0 then
		for i,trail in pairs(PlayerTrails:GetChildren()) do
			if table.find(data.trails, trail.Name) == nil then
				print(trail.Name)
				table.insert(data.trails, trail.Name)
			end
		end
	end
	
	local success, ErrorMsg = pcall(function()
		DataStore:SetAsync("player_"..player.UserId, data)
	end)
	
	if success == false then
		print("there was an error while saving players data")
		warn(ErrorMsg)
	end
end)

Hey there! I think that the Datastore Service doesn’t save 3d assets but it can save number, text, tables, etc. Most developers save the data associated with the model. For the trail, Don’t clone the model itself. Instead, save its properties. For example, you would want to save the trail Color, trail Image, trail Size, Etc. Then when a player joins the game, create a brand new trail and upload the saved properties to it. Hope this helps!

local trailOLD = "Reference to your trail"
local DATASTORE = game:GetService("DatastoreService"):GetDataStore("NewDatastore")

-- set up code for when the player joins
--set up datastore stuff
local trailData = {trailColor = trailOLD .Color, trailImg = trailOLD .Image, -- Continue with the other properties you wanna save}


--Player added functino
--GetData
local oldTrailData = Datastore:GetAsync(traildata)

local newTrail = isntance.new("Trail")
newTrail.Color = oldTrailData .Color
newTrail.Img = oldTrailData .Image

--End

--Player removing function

--Save data
DATASTORE:SetAsync(trailData) --Not how you actually store data, but you get the point


Note: THIS IS NOT FUNCTIONING CODE, it has a bunch of errors and not organized or efficient. This is just to give a visual representation of how it would look like.

im not saving the trail in the script, im saving its name