hi, the reason you have this issue is because the particles are only cloned once. I think what you were thinking of is making a seperate function and returning a new particles every time. To fix your error, do this: (Easiest Way)
01 | local Part = script.Parent |
04 | Part.Touched:Connect( function (player) |
05 | if Debounce = = true then |
06 | local Character = player.Parent |
07 | local RightUpperLeg = Character:WaitForChild( "RightUpperLeg" ) |
08 | local RightLowerLeg = Character:WaitForChild( "RightLowerLeg" ) |
09 | local RightFoot = Character:WaitForChild( "RightFoot" ) |
10 | local Poison 1 = game.Workspace.Poison.PoisonSparkles |
11 | local Poison 2 = game.Workspace.Poison.Poison |
13 | for i,v in pairs (Character:GetChildren()) do |
14 | if v:IsA( "MeshPart" ) then |
15 | Poison 1 :Clone().Parent = v |
16 | Poison 2 :Clone().Parent = v |
or this: (What you were thinking of)
01 | local Part = script.Parent |
05 | return game.Workspace.Poison.PoisonSparkles:Clone() |
08 | return game.Workspace.Poison.Poison:Clone() |
11 | Part.Touched:Connect( function (player) |
12 | if Debounce = = true then |
13 | local Character = player.Parent |
14 | local RightUpperLeg = Character:WaitForChild( "RightUpperLeg" ) |
15 | local RightLowerLeg = Character:WaitForChild( "RightLowerLeg" ) |
16 | local RightFoot = Character:WaitForChild( "RightFoot" ) |
18 | for i,v in pairs (Character:GetChildren()) do |
19 | if v:IsA( "MeshPart" ) then |
I hope I was able to help. With further questions/comments/concerns, feel free to reply to my answer. Happy scripting! ~mc3334