Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

game.Workspace.PlayerAdded:connect(function(plr-1)
	local TrailTest = Instance.new("ParticleEmitter")
	TrailTest.Name = "ParticleTrail"
	TrailTest.Parent = game.Workspace.Player.character.Torso
end)

1 comment

0

code block pls

2 answers

✓ Accepted answer

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)

3 comments

0

Thank you TheDeadlyPanther I'm not that great at scripting with Roblox coding, and this will help a lot.

0

How would I make this into a gamepass?

0

Use the PlayerOwnsAsset function (inside MarketplaceService).

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.

1 comment

0

How would you make it a gamepass though?

This discussion is preserved as it was. New answers, comments, and votes are closed.