In one of my games I have a script to add Stuff to the player, but with Trails, nothing happens, and there is no error. Here is the code:

--LocalScript
game:GetService('Players').PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").Died:connect(function() 
                    wait(6)
    local Trail = Instance.new("Trail")
    Trail.Texture = ("rbxassesid://891390006")
    Trail.Parent = player.Character["Right Arm"]
    Trail.Attachment0 = player.Character["Right Arm"].RightShoulderAttachment --Error
    Trail.Lifetime = 5
    Trail.LightEmission = 1
    Trail.Parent = player.Character["Right Arm"]
    Trail.MinLength = 2
    local Trail = Instance.new("Trail")
    Trail.Texture = ("rbxassesid://891390006")
    Trail.Parent = player.Character["Left Arm"]
    Trail.Attachment0 = player.Character["Left Arm"].LeftShoulderAttachment --Error
    Trail.Lifetime = 5
    Trail.LightEmission = 1
    Trail.Parent = player.Character["Left Arm"]
    Trail.MinLength = 2
        end)
    end)
end)    
game.Players.PlayerAdded:connect(function(player)
    while not player.Character do wait() end
    local Trail = Instance.new("Trail")
    Trail.Texture = ("rbxassesid://891390006")
    Trail.Parent = player.Character["Left Arm"]
    Trail.Attachment0 = player.Character["Left Arm"].LeftShoulderAttachment --Error
    Trail.Lifetime = 5
    Trail.LightEmission = 1
    Trail.Parent = player.Character["Left Arm"]
    Trail.MinLength = 2
    local Trail = Instance.new("Trail")
    Trail.Texture = ("rbxassesid://891390006")
    Trail.Parent = player.Character["Right Arm"]
    Trail.Attachment0 = player.Character["Right Arm"].RightShoulderAttachment --Error
    Trail.Lifetime = 5
    Trail.LightEmission = 1
    Trail.Parent = player.Character["Right Arm"]
    Trail.MinLength = 2
    end)

4 comments

1

Why are you using multiple PlayerAdded functions? Put it all into 1 of them. Also, make sure it's in a LocalScript. You must attatch it to an attatchment (ClassName: Attatchment) , it can't be a Part of any kind.

0

I tried it, but it still didn't work. Nothing happens, and there is no error.

0

Here is the new code: game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() wait(6) local Trail = Instance.new("Trail") Trail.Texture = ("rbxassesid://891390006") Trail.Parent = player.Character["Right Arm"] Trail.Attachment0 = play

0

I put the edit in the question.