So I was helped with adding fire to all the body parts when it touched with the fireball, however. I now want to get rid of the fire after a it does some damage (Simulating a burn effect).
local fire = game:GetService("ServerStorage").ParticleEmitter for _, v in pairs(hit.Parent:GetChildren()) do if v:IsA("BasePart") then if not v:FindFirstChild("ParticleEmitter") then fire:Clone().Parent = v --Solved^^^ for i = 1, 10 do hit.Parent.Humanoid:TakeDamage(1) wait(0.5) end wait(5) for _, v in pairs(hit.Parent:GetChildren()) do if v:IsA("BasePart") then if v:FindFirstChild("ParticleEmitter") then v.ParticleEmitter:Destroy() end end end --Unsolved^^^
Use the Debris Service.
local debrisService = game:GetService("Debris") local fire = game:GetService("ServerStorage"):FindFirstChild("ParticleEmitter") for _, v in pairs(hit.Parent:GetChildren()) do if v:IsA("BasePart") then if not v:FindFirstChild("ParticleEmitter") then local fireClone = fire:Clone() fireClone.Parent = v debrisService:AddItem(fireClone, 5) -- removes the object in 5 seconds for i = 1, 10 do hit.Parent.Humanoid:TakeDamage(1) wait(0.5) end
Hope this helps! :)