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

How To Clone A Particle Emitter Into A Player's Torso?

Hi, I'm trying to make it that if a player reaches a certain amount of rebirths and levels, they gain this particle emitter(Like an aura) cloned into their torso.

Here is my script:

game.Players.PlayerAdded:Connect(function(player)
	if player.leaderstats.Levels.Value >= 50 and player.leaderstats.Rebirths.Value >= 5 then
		game.ServerStorage.Auras.Lightning:Clone().Parent = player.Torso
print("Torso Given")
                
	end
end)

The script is a ServerScript inside of StarterCharacterScripts. The ParticleEmitter is in ServerStorage.

Is something wrong in the method I'm using to clone it? Or am I incorrectly accessing the torso? Also, the print doesn't show up.

2 answers

You seem to have mixed up the player and his character. The player object does not have a torso, however his character does; but in order to access the character you'll have to wait for the .CharacterAdded event to fire.

Like below:

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		particleEmitter:Clone().Parent = character:FindFirstChild("Torso")
	end)
end)

1 comment

0

Ok thanks, let me try it.

Ok, here is my script now

game.Players.PlayerAdded:Connect(function(player)
	local Aura = game.ServerStorage.Auras.Lightning
	player.CharacterAdded:Connect(function(Char)
		if player.leaderstats.Levels.Value >= 50 and player.leaderstats.Rebirths.Value >= 5 then
			Aura:Clone().Parent = Char:FindFistChild("Torso")
		end
	end)
end)

I still don't see anything print or any errors occur.

:

3 comments

0

FindFirstChild not FindFistChild.

0

Oops

0

I still don't see anything.

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