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

Attachments not attaching to trail?

Asked by 3 years ago
Edited 3 years ago

I’m creating a trail script that adds trails to the player’s body parts(legs, arms, and others). I tried to create the scripts and use attachments already made when the player spawns. However, whenever I set the attachments to the trail it doesn’t connect.

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

    plr.CharacterAdded:Connect(function (char)
        for i = 1,2 do
            local trail = game.ServerStorage:WaitForChild("Trail"):Clone()
            trail.Parent = char
            trail.Name = "Trail"..i
            print("trail added")
            trail.Enabled = true
            print(trail.Parent)
            if i == 1 then 
                local attach1 = char.LeftLowerArm:FindFirstChild("LeftElbowRigAttachment")
                local attach2 = char.LeftLowerArm:FindFirstChild("LeftWristRigAttachment")
                print(attach1)
                print(attach1.Parent)
                trail.Attachment0 = attach1
                trail.Attachment1 = attach2
                print(trail.Attachment0)
                print(trail.Attachment1)
            elseif i == 2 then
                local attach1 = char.RightLowerArm:FindFirstChild("RightElbowRigAttachment")
                local attach2 = char.RightLowerArm:FindFirstChild("RightWristRigAttachment")
                trail.Attachment0 = attach1
                trail.Attachment1 = attach2
                print(trail.Attachment0)
                print(trail.Attachment1)
            end
        end
    end)
end)

The attachments don’t connect to the trail. Pls help!

1 answer

Log in to vote
0
Answered by 3 years ago

umm try this i guess?

'o'

game.Players.PlayerAdded:Connect(function (plr)
    plr.CharacterAdded:Connect(function (char)
        for i = 1,2 do
            local trail = game.ServerStorage:WaitForChild("Trail"):Clone()
            trail.Parent = char
            trail.Name = "Trail"..i
            print("trail added")
            trail.Enabled = true
            print(trail.Parent)
            if i == 1 then 
                local attach1 = char.RightLowerArm:WaitForChild("LeftElbowRigAttachment")
                local attach2 = char.RightLowerArm:WaitForChild("LeftWristRigAttachment")
                print(attach1)
                print(attach1.Parent)
                trail.Attachment0 = attach1
                trail.Attachment1 = attach2
                print(trail.Attachment0)
                print(trail.Attachment1)
            elseif i == 2 then
                local attach1 = char.LeftLowerArm:WaitForChild("RightElbowRigAttachment")
                local attach2 = char.LeftLowerArm:WaitForChild("RightWristRigAttachment")
                trail.Attachment0 = attach1
                trail.Attachment1 = attach2
                print(trail.Attachment0)
                print(trail.Attachment1)
            end
        end

    end)
end)

if it doesn't work, dm me on discord because i need more specific questions, and please screenshot the explorer

Blue Duck#8344

0
K I friended on you discord. raahatu 6 — 3y
Ad

Answer this question