Issue with ParticleEmitter & Character

I’m not sure what I did wrong here, when a Player joins the game I simply want to add a Particle to their Torso. I tried looking up examples of how it’s done but there was none.

The script isn’t erroring for me which also doesn’t help me.

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local Humanoid = character:WaitForChild("Humanoid")
		local HeartEffect = game.ServerStorage.Effects:WaitForChild("Hearts")
		local Torso  = player.Character:FindFirstChild("UpperTorso")	

		HeartEffect = Torso
		
	end)
end)

Any feedback is appreciated :grin:

Ah very close, but you’re not quite doing what you need to do for HeartEffect. You’ll want to clone it and set its parent of the cloned effect, which you apparently are not doing. HeartEffect = Torso sets the HeartEffect variable to the UpperTorso you got earlier.

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local Humanoid = character:WaitForChild("Humanoid")
		local HeartEffect = game.ServerStorage.Effects:WaitForChild("Hearts"):Clone()
		local Torso = character:FindFirstChild("UpperTorso")	
		HeartEffect.Parent = Torso
	end)
end)

I tried doing this but still doesn’t work, no errors neither.

You could also put a particle emitter in StarterCharacterScripts. Everything in there gets put inside the players character

Hmm… It sounds like the script isn’t even able to run. Are you sure its a descendant of either the workspace or ServerScriptService?

@DataSigh That’s not a bad idea, but it would probably be better to keep all of the effects in one place.

I tried what @DataSigh mentioned but issue with it. It duplicates the whole File and doesn’t place it in the Torso so the ParticleEmitter just spawns in the middle of the baseplate.

You could try adding this at the end

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local Humanoid = character:WaitForChild("Humanoid")
		local HeartEffect = game.ServerStorage.Effects:WaitForChild("Hearts")
		local Torso  = player.Character:FindFirstChild("UpperTorso")	

		HeartEffect = Torso
		
	end)
end)

for _, player in Players:GetPlayers() do
	player.CharacterAdded:Connect(function(character)
		local Humanoid = character:WaitForChild("Humanoid")
		local HeartEffect = game.ServerStorage.Effects:WaitForChild("Hearts")
		local Torso  = player.Character:FindFirstChild("UpperTorso")	

		HeartEffect = Torso
		
	end)
end

Still doesn’t work and there’s no errors in the output, what actually worked was adding the ParticleEmitter in StarterCharacterScripts but it doesn’t parent it to the Torso just the Character model for some reason.

I think it would be much better if the Effects file would be in the ServerStorage though.

Could also just reparent the emitter from a script in StarterCharacterScripts to the torso