I am trying to add a particle emitter to this attack , it causes the attack to just freeze in one place (it's a ranged attack) (it is the Y variable i'm trying to add)
for i = 1, 50 do
wait(0.01)
ShockWave1 = Instance.new("Part")
ShockWave1.Parent = workspace
ShockWave1.Size = Vector3.new(math.random(10, 10), math.random(10, 10), math.random(10, 10))
ShockWave1.formFactor = "Symmetric"
ShockWave1.Anchored = true
ShockWave1.Shape = "Ball"
ShockWave1.CanCollide = false
ShockWave1.Transparency = 0.4
ShockWave1.TopSurface = "Smooth"
ShockWave1.BottomSurface = "Smooth"
zomg = math.random(1, 2)
if zomg == 1 then
ShockWave1.BrickColor = BrickColor.new("Really black")
end
if zomg == 2 then
ShockWave1.BrickColor = BrickColor.new("Black")
end
m = Instance.new("CylinderMesh")
m.Parent = ShockWave1
m.Scale = Vector3.new(0.25*(i/2), 0.25*(i/2), 1.5*(i/2))
y=Instance.new("ParticleEmitter",ShockWave1)
y.Texture= "rbxasset://textures/particles/sparkles_main.dds"
y.Color=Color3.new(255,255,127)
y.LockedToPart=true
ShockWave1.Name = "ShockWavePart"
game.Debris:AddItem(ShockWave1, 0.2)

2 comments
y = Instance.new('Particle Emitter')
Thanks for the answer, this (like the answer below) inserts the particle emitter but it keeps making the projectile its being inserted into disappear