Trail Doesn't Work With StarterCharacter

I’ve replaced my player’s look with a blank r15 block model as the startercharacter, but I want everyone to have a trail. I’ve put the trail in ServerStorage, I’ve typed out my script and everything seems to be printing correctly, but for some reason the trail won’t show.

This is my script:

game.Players.PlayerAdded:Connect(function(player, Legend)
	player.CharacterAdded:Connect(function(char)
		wait(12)
		print("Load complete")
		
		local skin = game.StarterPlayer:FindFirstChild("StarterCharacter")
		local TestSkin = skin.Test

		if Test.Value == "Base" then
			
			local OTrail = game.ServerStorage.OTrail:Clone()
			OTrail.Parent = skin.Head
			OTrail.Enabled = true
				
			local attachment0 = Instance.new("Attachment", skin.Head)
			attachment0.Name = "TrailAttachment0"
			local attachment1 = Instance.new("Attachment", skin.HumanoidRootPart)
			attachment1.Name = "TrailAttachment1"
			OTrail.Attachment0 = attachment0
			OTrail.Attachment1 = attachment1
			print("All aboard!")
		end
	end)
end)

I’ve made sure that the trail clones to the character and is set to enabled, but it doesn’t come up. What’s even more confusing is that the trail works just fine without the starter character model. How can I fix this?

When the game starts in Studio or in a live server, those items under StarterGui, StartPlayer and in your instance StarerCharacter get cloned to the joining player and character. IIf you have manually created a StarterCharacter, then that will be cloned as the new Player character in the workspace.

To reference the character in your script:

local skin = game.StarterPlayer:FindFirstChild("StarterCharacter") -- NO
-- use
local skin = player.Character

I’d also recommend removing the wait(12) as this will probably kick in when a player respawns, causing long pauses.

In place of wait(12) try:

local char = player:WaitForChild("Character")

That way it will only wait for as long as it has to.

For trails however, I found lots of players + lots of trails = lots of lag. If you move the trail into ReplicatedStorage and move your script to StartPlayerScripts, it will handle the effect locally on all characters spawned which is more efficient.