If you are looking for
ParticleEmitters
like electric sparks then you have to make your own; you can still use the
ParticleEmitter
Instance but it won’t look realistic and won’t have collisions.
So I made this module couple minutes ago for this purpose.
local Debris = game:GetService("Debris")
local module = {}
module.particleType = {
electricSparks = 0
}
function module:emit(particleType, cframe, velocity, rate, size, lifetime, collideable)
if particleType == 0 then
for i = rate, 0, -1 do
local part = Instance.new("Part")
local trail = Instance.new("Trail")
local trace0 = Instance.new("Attachment", workspace.Terrain)
local trace1 = Instance.new("Attachment", workspace.Terrain)
part.Anchored = false
part.CanCollide = collideable
part.CastShadow = false
part.Locked = true
part.Massless = true
part.Transparency = 1
part.Size = Vector3.new(0.1, 0.1, 0.1)
part.CFrame = cframe + Vector3.new(math.random(0, 1) * size, part.Size.Y / 2, math.random(0, 1) * size)
part.Parent = workspace
trace0.Parent = part
trace1.Parent = part
trace0.Position -= Vector3.new(1, 1, 1) * size
trace1.Position += Vector3.new(1, 1, 1) * size
trail.Color = ColorSequence.new(Color3.fromRGB(228, 255, 187), Color3.fromRGB(234, 255, 194))
trail.Transparency = NumberSequence.new(0)
trail.WidthScale = NumberSequence.new(size)
trail.FaceCamera = true
trail.Lifetime = NumberSequence.new(lifetime)
trail.LightEmission = 1
trail.LightInfluence = 1
trail.Attachment0 = trace0
trail.Attachment1 = trace1
trail.Parent = part
part.Velocity = Vector3.new(math.random(-velocity, velocity), velocity, math.random(-velocity, velocity)) -- TODO: Replace .Velocity with the new method because this is going to be deprecated!
Debris:AddItem(part, lifetime)
end
end
end
return module
Then you can use LocalScript
to use it. Feel free to add more properties and types of particles.
local ParticleEmitter = require(script.ParticleEmitter)
while wait(0.5) do
ParticleEmitter:emit(ParticleEmitter.particleType.electricSparks, workspace.Part.CFrame, 100, 100, 0.1, 3, true)
end
If you want to see it yourself, you can download this example that I made: CustomParticleEmitterExample.rbxl (22.7 KB)
You can also play with the LightInfluence
property to make the sparks more shiny.