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

Does anyone know how to make a particle trail and give it to the player when he/she enters the game?

Asked by
RGRage 45
8 years ago

I have tried multiple ways to make a particle trail system for the player when they enter the game, but unfortunately I have had no luck with making it. Can someone please help me make a particle trail system. It would be very helpful! (I was never really good at scripting in "Lua Script" anyway. I am still learning Info: These are ways that I tried to make a particle trail system, but they didn't work- 1)

game.Workspace.Player.Torso:connect(function(t-1-1)
    local TrailTest = Instance.new("ParticleEmitter")
    TrailTest.Name = "TrailTest"
    TrailTest.Parent = game.Workspace.Player1.Torso
end)

2)


game.Workspace.PlayerAdded:connect(function(plr-1) local TrailTest = Instance.new("ParticleEmitter") TrailTest.Name = "ParticleTrail" TrailTest.Parent = game.Workspace.Player.character.Torso end)
0
code block pls yoshi8080 445 — 8y

2 answers

Log in to vote
2
Answered by 8 years ago

This is what you're doing wrong:

1)

  • Torso is not a event.

  • This script will only run for a Player with the name of Player

  • That t-1-1 might return errors, I do not see what you're trying to do there.

  • Scripts and objects in the game will take some time to load, so this script will return errors that Player does not exist.

2)

  • PlayerAdded is an event of Players, not Workspace.

  • 'Player' in Workspace is not a Player object. It does not have a child of character, because the Player is the character object.

To fix your code:

game.Players.PlayerAdded:connect(function(p)
    p.CharacterAdded:connect(function(char)
        local TrailTest = Instance.new("ParticleEmitter")
        TrailTest.Name = "TrailTest"
        TrailTest.Parent = char:WaitForChild("Torso")
    end)
end)

0
Thank you TheDeadlyPanther I'm not that great at scripting with Roblox coding, and this will help a lot. RGRage 45 — 8y
0
How would I make this into a gamepass? Pot8o_Penguin 50 — 7y
0
Use the PlayerOwnsAsset function (inside MarketplaceService). TheDeadlyPanther 2460 — 7y
Ad
Log in to vote
0
Answered by 8 years ago

An easier way of doing this is to use a local script. It should be located inside a client - side service (I recommend the StarterPlayerScripts folder located in the Starter Players service. Then copy the following script:

player = game.Players.LocalPlayer
if player~=nil then
    if player.Character.Humanoid.Health==0 then
    wait(7)
    Particle = Instance.new("ParticleEmitter")
    Particle.Parent = player.Character.Torso
else
    wait(1)
    Particle = Instance.new("ParticleEmitter")
    Particle.Parent = player.Character.Torso
end

Otherwise there is one major error in your function. The PlayerAdded event is not a member of the workspace. Just switch around "Workspace with Players". First I suggest you test the script above.

0
How would you make it a gamepass though? Pot8o_Penguin 50 — 7y

Answer this question