This is a small portion of a fireball script I'm working on, I want to make it so that on contact, it lights the player on fire(All of their body parts). How would I make it so that the particle emitters position matched that of the body parts.
fireball.Touched:connect(function(hit) local fire = game.Lighting.ParticleEmitter:Clone() for i,v in pairs(hit.Parent:GetChildren()) do
Using this script, I tried to make it so that the Particle emitter would be inserted into each thing inside a character. But it did not work. Instead, the particle emitter(s) is/are laying on the baseplate and I have no idea where in the explorer they are located.
In short, the question is how can I position particle emitters to be where I want them to (With most things I use (Object).CFrame = (OtherObject).CFrame)
for
loop to iterate through hit.Parent
's children. What's left is to clone the particle emitter. Also, don't use Lighting
as storage as we have services like ServerStorage
to use as storage. Using Lighting
to store things is unsupported by ROBLOX.local fire = game:GetService("ServerStorage").ParticleEmitter fireball.Touched:Connect(function(part) -- uppercase C for _, v in pairs(part.Parent:GetChildren()) do if v:IsA("BasePart") then -- if it's a part if not v:FindFirstChild("ParticleEmitter") then -- don't want to spam fire:Clone().Parent = v -- clone fire and parent to the part end end end end)