Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Attachments won't parent to the head?

Asked by 3 years ago

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)



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 momgggbghghghghg 50 — 3y
0
Yeah it gets created, i tried adding it to the humanoid root part. Works fine now. Hopefully no more bugs. raahatu 6 — 3y
0
what kind of game are you making? momgggbghghghghg 50 — 3y
0
not rlly a game just a mechanic rolling but i need the trails for effects raahatu 6 — 3y
View all comments (4 more)
0
can you friend me on my momgggbghghghghg account? momgggbghghghghg 50 — 3y
0
? raahatu 6 — 3y
0
my account name is momgggbghghghghg can you add me back? momgggbghghghghg 50 — 3y
0
because i would love to make a game with ya! :D momgggbghghghghg 50 — 3y

Answer this question