Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to clone particles in your character?

Asked by 5 years ago

This is a continuation to the fade script except it clones the particle in the head. Now i was wondering how to clone it all of the parts when a character dies.

local Particle = game:GetService("ServerStorage"):WaitForChild("Dust")

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        char.Humanoid.Died:Connect(function()
        local Cloned = Particle:Clone()
        Cloned.Parent = game.Workspace:WaitForChild(player.Name).Head
        wait(1)
            for _, v in pairs(char:GetDescendants()) do
                if v:IsA("BasePart") then
                    spawn(function()
                        for i = 0,1,.01 do
                            v.Transparency = i
                            wait()
                        end
                    end)
                end
            end
        end)
    end)
end)
0
cant u just do char.Head instead of *game.Workspace:WaitForChild(player.Name).Head* User#23365 30 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Hello! I see you want to place the particles effect on every part in the character, right? Well you forgot to place the particles in all parts, but you did get the transparency part right, heres the edited script to help you.

local Particle = game:GetService("ServerStorage"):WaitForChild("Dust")

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        char.Humanoid.Died:Connect(function()
    --For loop through the character, and place cloned particles on them
        for _, v in pairs(char:GetDescendants()) do
                if v:IsA("BasePart") then
                    local Cloned = Particle:Clone()
                   Cloned.Parent = v
                end
            end
        wait(1)
            for _, v in pairs(char:GetDescendants()) do
                if v:IsA("BasePart") then
                    spawn(function()
                        for i = 0,1,.01 do
                            v.Transparency = i
                            wait()
                        end
                    end)
                end
            end
        end)
    end)
end)

I forgot to fix a little part of the script, i edited for you, so this should work if the last one didnt.

Ad

Answer this question