I need to instance new attachments and parent them to the head. I printed out the parents for each attachment and it said head. But when I check the explorer that are no attachments inside the player's head.

game.Players.PlayerAdded:Connect(function (plr)

	plr.CharacterAdded:Connect(function (char)
		local trail = game.ServerStorage:WaitForChild("Trail"):Clone()
		trail.Parent = char.Head.Parent
		print("trail added")
		trail.Enabled = false
		local attachment0 = Instance.new("Attachment", char.Head)
		attachment0.Name = "TrailAttatchment0"
		attachment0.Position = attachment0.Position - Vector3.new(1,2,0)
		local attachment1 = Instance.new("Attachment", char.Head)
		attachment1.Name = "TrailAttachment1"
		attachment1.Position = attachment0.Position - Vector3.new(0,1,0)
		trail.Attachment0 = attachment0
		trail.Attachment1 = attachment1
		print(attachment0.Parent)
		print(attachment1.Parent)

		------Second Trail
		local trail2 = game.ServerStorage:WaitForChild("Trail"):Clone()
		trail2.Name = "Trail2"
		trail2.Parent = char.Head.Parent
		print("trail2 added")
		trail2.Enabled = false
		local attachment2 = Instance.new("Attachment", char.Head)
		attachment2.Name = "TrailAttatchment2"
		attachment2.Position = attachment2.Position - Vector3.new(-1,2,0)
		local attachment3 = Instance.new("Attachment", char.Head)
		attachment3.Name = "TrailAttachment3"
		attachment3.Position = attachment2.Position - Vector3.new(0,1,0)
		trail2.Attachment0 = attachment2
		trail2.Attachment1 = attachment3

		----Particle Cloud---
		local cloud = game.ServerStorage:WaitForChild("Smoke"):Clone()
		local attachment5 = Instance.new("Attachment", char.HumanoidRootPart)
		attachment5.Name = "TrailAttatchment5"
		cloud.Parent = attachment5
		cloud.Enabled = false

	end)
end)



8 comments

0

are you making a new one and trying to make it the child of the parents head? youll have to run the game and see if it got created when the script runs

0

Yeah it gets created, i tried adding it to the humanoid root part. Works fine now. Hopefully no more bugs.

0

what kind of game are you making?

0

not rlly a game just a mechanic rolling but i need the trails for effects

0

can you friend me on my momgggbghghghghg account?

0

?

0

my account name is momgggbghghghghg can you add me back?

0

because i would love to make a game with ya! :D