I have a particle emitter, using a flipbook particle. I have set the Enabled
attribute to false
(as that’s what Roblox says to do when you’re controlling it via script) and it doesn’t emit anything when I use :Emit()
with any number. The only time it emits is when u have Enabled
set to true
it works, but it’s delayed bc its just emitting on its own. How am I supposed to do this?
bump because people won’t help me.
1 Like
local particleEmitter = script.Parent -- Replace with the actual path to your ParticleEmitter
-- Set Enabled to false to control via script
particleEmitter.Enabled = false
-- Function to emit particles
local function emitParticles()
wait(0.1) -- Delay to ensure the emitter is ready
particleEmitter:Emit(50) -- Replace 50 with the number of particles you want to emit
end
-- Example of calling the function, replace with your actual event or condition
emitParticles()
1 Like
function module:emitParticle(emitter: ParticleEmitter, num: number, pos: Vector3)
local a = Instance.new("Part")
a.Size = Vector3.new(0,0,0)
a.Transparency = 1
a.Anchored = true
a.Position = pos
a.Parent = workspace:WaitForChild("particles")
local b = emitter:Clone()
b.Parent = a
emitter:Clear()
wait()
emitter:Emit(num)
print("emitted")
debris:AddItem(a, b.Lifetime.Max + 3)
end
this is my function that i have had. emitter
is an emitter that has Enabled
set to false
So what do you want me to do here with this context script or editing it
im saying my script is doing the same thing as yours
local Debris = game:GetService("Debris")
function module:emitParticle(emitter: ParticleEmitter, num: number, pos: Vector3)
-- Clone the emitter to not interfere with the original one
local emitterClone = emitter:Clone()
-- Create a new Part to host the cloned emitter
local hostPart = Instance.new("Part")
hostPart.Size = Vector3.new(0.1, 0.1, 0.1) -- Slightly larger than (0,0,0) to ensure visibility
hostPart.Transparency = 1 -- Make the part invisible
hostPart.Anchored = true
hostPart.CanCollide = false -- Prevent the part from interfering with other objects
hostPart.Position = pos
hostPart.Parent = workspace
-- Set up the cloned emitter
emitterClone.Enabled = true -- Enable the emitter to ensure it can emit when Emit() is called
emitterClone.Parent = hostPart
-- Emit the particles
emitterClone:Emit(num)
-- Clean up the host part and emitter after the particles are done
Debris:AddItem(hostPart, emitterClone.Lifetime.Max + 3)
end
I will try this when I get home, fingers crossed!
it worked, tweaked it a little but it worked! thank you!
function module:emitParticle(emitter: ParticleEmitter, num: number, pos: Vector3)
local emitterClone = emitter:Clone()
local hostPart = Instance.new("Part")
hostPart.Size = Vector3.new(0.1, 0.1, 0.1)
hostPart.Transparency = 1
hostPart.Anchored = true
hostPart.CanCollide = false
hostPart.Position = pos
hostPart.Parent = workspace
emitterClone.Enabled = true
emitterClone.Parent = hostPart
emitterClone:Emit(num)
emitterClone.Enabled = false -- i added this line
debris:AddItem(hostPart, emitterClone.Lifetime.Max + 3)
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.