New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to put particle in all body?

Asked by 11 days ago
Edited 11 days ago

~ I want the particle to go to the head, torso, arms, legs, every part of the body, and then to disappear.

event.OnServerEvent:Connect(function(player)
local CloneP        = game.ReplicatedStorage.Particles.ParticleEmitter
local character  = player.Character

for i,v in pairs(character:GetChildren()) do
    if v:IsA("Part") or v:IsA("MeshPart") then

        local Particle    = CloneP:Clone()
        Logia.Parent = v
                        game.Debris:AddItem(Particle, 1.5)

         end
       end
end)
0
I don't know what you mean. Can you elaborate on what you're trying to do here? x1x3x6x9x12x15x 42 — 11d
0
I want to put a particle in each body part. HumanoidRootPart, Head etc, everything in character. ToddyWars 41 — 11d
0
Without having to put one in one .-- Particle.Parent = Head --Particle.Parent = Torso --understand? ToddyWars 41 — 11d

1 answer

Log in to vote
1
Answered by
Azarth 2414 Moderation Voter Community Moderator
11 days ago
Edited 11 days ago
-- ParticleEmitter Doesn't need to be indexed everytime the Event is called, keep it outside of the event scope
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local ParticlesFolder = ReplicatedStorage:WaitForChild("Particles")
local ParticleEmitter = ParticlesFolder:WaitForChild("ParticleEmitter")
local event --= event here

event.OnServerEvent:Connect(function(player)
    local character  = player.Character
    if character then 
        -- You don't have to have the humanoid part
        local humanoid = character:FindFirstChild("Humanoid")
        if humanoid and humanoid.Health > 0 then 
            for _, Child in pairs(character:GetChildren()) do
                if Child:IsA("BasePart") or Child:IsA("MeshPart") then
                    local ClonedParticle = ParticleEmitter:Clone()
                    -- Child falls within the parameters
                        -- Parent ClonedParticle to Child
                    ClonedParticle.Parent = Child
                    game.Debris:AddItem(ClonedParticle, 1.5)
                end
            end
        end
    end
end)
0
This system of verifying the character already has in LocalScript, I will test. ToddyWars 41 — 11d
Ad

Answer this question