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

how do i place a particleemiter on multiple character parts easier?

Asked by 5 years ago
Edited 5 years ago

Hello, i was just wondering if there is an easy way to do this since i would have to do this with every other body part, look at the code and the disabled line to understand, yes i know that the disabled line won't work like i want it to. i just started lua so don't judge me :P

local p1 = game.ServerStorage.Nebulea1

local p2 = game.ServerStorage.Nebulea2

local p3 = game.ServerStorage.Nebulea3

local p4 = game.ServerStorage.Nebulea4



game.Players.PlayerAdded:Connect(function(plr)

plr.CharacterAdded:Connect(function(char)

local plrP1 = p1:Clone()

local plrP2 = p2:Clone()

local plrP3 = p3:Clone()

local plrP4 = p4:Clone()

--plrP1.Parent = char.UpperTorso, char.LowerTorso, char.RightLowerArm, char.LeftLowerArm, char.RightLowerLeg, char.LeftLowerLeg

plrP2.Parent = char.UpperTorso

plrP3.Parent = char.UpperTorso

plrP4.Parent = char.UpperTorso

end)

end)
0
Loop thorugh the player and clone to the parts that r being looped though using in pairs AizakkuZ 226 — 5y

1 answer

Log in to vote
0
Answered by
H3kken -4
5 years ago

Make a for loop that loops though the player's meshparts/bodyparts. This should work:

game.Players.PlayerAdded:Connect(function(plr)
 plr.CharacterAdded:Connect(function(chr)
 local p1 = game.ServerStorage:WaitForChild("Nebulea1")
 local p2 = game.ServerStorage:WaitForChild("Nebulea2")
 local p3 = game.ServerStorage:WaitForChild("Nebulea3")
 local p4 = game.ServerStorage:WaitForChild("Nebulea4")
 local Cp1 = p1:Clone()
 local Cp2 = p2:Clone()
 local Cp3 = p3:Clone()
 local Cp4 = p4:Clone()
 Cp2.Parent = chr:WaitForChild("UpperTorso")
 Cp3.Parent = chr.UpperTorso
 Cp4.Parent = chr.UpperTorso
 for i,v in pairs(chr:GetChildren()) do
 if v:IsA("MeshPart") then
 Cp1.Parent = v
 end
 end
 end)
 end)

Hope that works. Good luck with our game.

Ad

Answer this question