How do I clone a single particle into multiple parts?

I’m trying to make an effect that gets on every single part of the player, although I’m having trouble with this. 2 problems, first, I don’t know how I would get the children of the character excluding the other parts like the head and humanoid, ect. Second, how would I clone it into each part of the table? This is not the full code, and I only need some help with my questions.

	fire_curse:newAttack(Enum.KeyCode.K,function()
		local char = plr.Character
		local FXstorage = clientStorage.FXStorage
		local steamEffect = FXstorage.SteamMode:Clone()
		print('steam')
		for i,v in pairs(char.Humanoid:GetChildren()) do 
			steamEffect.Parent = v
			wait(10)
			steamEffect:Destroy()
		end
	end)

Try getting the children of the char, not the humanoid

	fire_curse:newAttack(Enum.KeyCode.K,function()
		local char = plr.Character
		local FXstorage = clientStorage.FXStorage
		local steamEffect = FXstorage.SteamMode:Clone()
		print('steam')
		for i,v in pairs(char:GetChildren()) do 
            if not v:IsA("BasePart") or v.Name == "Head" then continue end
			steamEffect.Parent = v
			spawn(function()
                wait(10)
			    steamEffect:Destroy()
           end)
		end
	end)

edited: Adjusted the code a bit to meet your requirements
edited again: made it fit the requirements even more

Oh thats on me lol. I’m so stupid for writing humanoid. :joy: Although I’m still getting repeated nils inside of the dev console. As I previously said I have no idea if steamEffect.Parent = v even works for me because its a single clone trying to parent itself to multiple meshes.

Oh yeah, you can just clone it again!

	fire_curse:newAttack(Enum.KeyCode.K,function()
		local char = plr.Character
		local FXstorage = clientStorage.FXStorage
		print('steam')
		for i,v in pairs(char:GetChildren()) do 
            if not v:IsA("BasePart") or v.Name == "Head" then continue end
            local steamEffect = FXstorage.SteamMode:Clone()
			steamEffect.Parent = v
			spawn(function()
                wait(10)
			    steamEffect:Destroy()
           end)
		end
	end)

wait nevermind i believe its coming from something else, but I don’t know where its coming from. although the other issue still could be a thing. How do i check where nils are coming from?

If you run it in studio, you should be able to click what is outputed to go to the location it was run from (click it while the game is still running in studio, as it is a localscript)

what do i click? mmmmmm30000000

found it, give me one moment to fix it and reimplement the steam effect. ill let you know if its working or not. :smile:

It works now thank you for all the help, you’re a life saver. I never would have knew you could check what type of object is inside of a table when you iterate over it. I wont forget this skill!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.