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
9 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)

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

2)

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

2 answers

Log in to vote
2
Answered by 9 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:

1game.Players.PlayerAdded:connect(function(p)
2    p.CharacterAdded:connect(function(char)
3        local TrailTest = Instance.new("ParticleEmitter")
4        TrailTest.Name = "TrailTest"
5        TrailTest.Parent = char:WaitForChild("Torso")
6    end)
7end)
0
Thank you TheDeadlyPanther I'm not that great at scripting with Roblox coding, and this will help a lot. RGRage 45 — 9y
0
How would I make this into a gamepass? Pot8o_Penguin 50 — 8y
0
Use the PlayerOwnsAsset function (inside MarketplaceService). TheDeadlyPanther 2460 — 8y
Ad
Log in to vote
0
Answered by 9 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:

01player = game.Players.LocalPlayer
02if player~=nil then
03    if player.Character.Humanoid.Health==0 then
04    wait(7)
05    Particle = Instance.new("ParticleEmitter")
06    Particle.Parent = player.Character.Torso
07else
08    wait(1)
09    Particle = Instance.new("ParticleEmitter")
10    Particle.Parent = player.Character.Torso
11end

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 — 8y

Answer this question