Hello everyone! Currently I am having an issue where the :Emit() function for particle emitters doesn’t seem to want to work for some unknown reason. I am making a gun system and it’s relating to the particles that appear when the “bullet” hits a part.
Below is the code relating to this issue is annotated with “<<<< HERE HERE HERE” for your convience (Not the full script just the relevant portions, if you need more just lemme know)
What I’ve Tried
Anywho, I’ve tried using wait(), task.wait(), task.wait(1), messing with properties of the emitter itself, changing the order of how the emitter is cloned and parented, changing the amount that is emitted from the variable value to 1, 10, 100, 1000 with no change and a bunch of others things I can’t thing of at the moment. There are no errors and no warnings and the Audio and Decal themselves appear and play as normal it’s just the emitter. I will also link pictures of the emitter properties along with visuals of what I’m working with.
HitEvent.OnServerEvent:connect(function(User, Position, Direction, L_145_arg4, L_146_arg5, HitType, HitPart)
if HitPart then
local BH_Part = Instance.new("Part")
BH_Part.CFrame = CFrame.new(Position) * CFrame.fromAxisAngle(Direction.magnitude == 0 and Vector3.new(1) or Direction.Unit, L_145_arg4)
BH_Part.Size = Vector3.new(0.5, 0, 0.5)
BH_Part.Transparency = 1
BH_Part.BottomSurface = 0
BH_Part.TopSurface = 0
BH_Part.CanCollide = false
BH_Part.CanQuery = false
BH_Part.Anchored = true
BH_Part.FormFactor = "Custom"
BH_Part.Parent = HitPart
if HitType == "Part" then
local Material = HitPart.Material.Name
local HasAssets = BulletEffects:FindFirstChild(Material)
if not HasAssets then
if MaterialList[Material] then
Material = MaterialList[Material]
else
Material = "Default"
end end
local ParticleEffects = BulletEffects[Material].Particles
local SoundEffects = BulletEffects[Material].Sounds
local HoleEffects = BulletEffects[Material].Holes
local Sound = nil
local BH_Texture = HoleEffects[math.random(#HoleEffects:GetChildren())]:Clone()
BH_Texture.Parent = BH_Part
if #SoundEffects:GetChildren() > 0 then
Sound = SoundEffects[math.random(#SoundEffects:GetChildren())]
else
SoundEffects = BulletEffects["Default"].Sounds
Sound = SoundEffects[math.random(#SoundEffects:GetChildren())]
end
local BH_Sound = Sound:Clone()
BH_Sound.Parent = BH_Part
BH_Sound:Play()
for _, Emitter in ipairs(ParticleEffects:GetChildren()) do
local EmitCount = Emitter:GetAttribute("Amount") or 1
local ClonedEmitter = Emitter:Clone()
ClonedEmitter.EmissionDirection = "Top"
ClonedEmitter.Parent = BH_Part
Emitter:Emit(EmitCount) <<<< HERE HERE HERE
end
Workspace
ParticleProperties