Hello I'm trying to clone a trail to stay on a character and it isn't doing it giving the message "attempt to index nil with 'Clone'". I know it has something to do with parenting but i cant seem to find the issue.
Code in question:
local trailCopy = Trail:Clone()
trailCopy.Parent = character.Head
full code:
local ServerStorage = game:GetService("ServerStorage")
local Trail = ServerStorage:FindFirstChild("Trial")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local trailCopy = Trail:Clone()
trailCopy.Parent = character.Head
local att0 = Instance.new("Attachment", character.Head)
att0.Name = "att0"
local att1 = Instance.new("Attachment", character.HumanoidRootPart)
att1.Name = "att1"
trailCopy.Attachment = att0
trailCopy.Attachment = att1
trailCopy.Enabled = true
end)
end)
