Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Attachments not attaching to trail?

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

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

1 comment

0

K I friended on you discord.

This discussion is preserved as it was. New answers, comments, and votes are closed.