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

Trails never being created or showing up?

Asked by
Admin8483 -21
6 years ago
Edited 6 years ago

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)

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. User#2146 0 — 6y
0
I tried it, but it still didn't work. Nothing happens, and there is no error. Admin8483 -21 — 6y
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 Admin8483 -21 — 6y
0
I put the edit in the question. Admin8483 -21 — 6y

Answer this question