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!
umm try this i guess?
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