Confused about Rainbow Trail

Hello! I am trying to make a script for a rainbow trail, I am not sure what is done wrong, here is the script.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local trail = game.ServerStorage.Trail:Clone()
trail.Parent = char.Head
local attachment0 = Instance.new(“Attachment”,char.Head)
attachment0.Name = “TrailAttachment0”
local attachment1 = Instance.new(“Attachment”,char.Head)
attachment1.Name = “TrailAttachment1”
trail.Attachment0 = attachmennt0
trail.Attachment1 = attachment1
end
end)

1 Like

Have you checked for errors? There’s a simple typo in attachment0 that will break your script.

No, there is no errors at all.

Did you accidentally add the typo when posting in here? There would definitely be an error with an extra ‘n’ inside of your variable.

Another problem I can see is that you put both attachments under the player’s head. You will need to parent one of the attachments to another body part, such as HumanoidRootPart.

2 Likes

OH I DID! THANK YOU! :slightly_smiling_face:

Sorry to ask but, how do you do that? On the 2nd bit.

Creating an instance has two arguments, The object you want to create, and optional if you want to parent that object to something
Instance.new("ObjectType", ObjectParent)

For both of your attachments, you set the parent as char.Head.
You can easily change one of the parents to char.HumanoidRootPosition, or char.LowerTorso might be better for r15 characters.