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