SGEffects | Script Generated Effects.
Introducing SG Effects, SG Effects is a ModuleScript for creating, building, customizing, and managing effects easily that are created by this script. The effects run mostly on TweenService for control and customizability, there are also some non-tween based effects that use an RBXScriptConnection.
Examples:
Simple Script Example
local SGEffects = require(script.SGEffects)
local Part = Instance.new("Part")
Part.Position = Vector3.new(-0.71, 95.387, -0.72)
Part.Anchored = true
Part.Parent = workspace
task.wait(1)
for i = 1, 50 do
local Clone = Part:Clone()
Clone.Parent = workspace
local SO = SGEffects:ScatterOut(Clone)
local SF = SGEffects:SizeFactor(Clone)
SO:Play()
SF:Play()
end
Part:Destroy()
Result:
Complex Script Example
local SGEffects = require(script.SGEffects)
SGEffects.Autoplay = true
local Part = Instance.new("Part")
Part.Position = Vector3.new(-0.71, 95.387, -0.72)
Part.Anchored = true
Part.Parent = workspace
task.wait(2)
local Parts = {}
local Effects = 30
for i = 1, Effects do
local Clone = Part:Clone()
Clone.Name = "Effect"
Clone.Parent = workspace
table.insert(Parts, Clone)
end
Part:Destroy()
for i,v in next, Parts do
local ScatterOut = SGEffects:ScatterOut(v, nil, {-23, 23}, 1.5)
local SizeOut = SGEffects:SizeFactor(v, nil, 1.5 + 1.0)
if i == #Parts then
SizeOut.Completed:Wait()
end
end
for i = 1, #Parts do
Parts[i]:Destroy()
end
Parts = {}
Result:
Scenarios:
- Fire Particles.
Fire Particles Code Example
local SGEffects = require(script.SGEffects)
SGEffects.Autoplay = true
local Colors = {
BrickColor.new("Deep orange").Color,
BrickColor.new("Yellow flip/flop").Color
}
local function FireParticle(CF)
local Part = Instance.new("Part")
Part.Anchored = true
Part.Size = Vector3.new(0.562, 0.523, 0.53)
Part.Color = Colors[math.random(1, #Colors)]
Part.Material = Enum.Material.Neon
Part.CFrame = CF
Part.Parent = workspace
return Part
end
local function Rnum(min, max)
return Random.new():NextNumber(min, max)
end
while true do
coroutine.resume(coroutine.create(function()
local Particle = FireParticle(CFrame.new(-3, 0, 162))
local Scatter = SGEffects:CompleteScatterOut(Particle, {-10, 35}, {8, 20}, {-10, 35}, nil, Rnum(0.5, 10))
task.wait(0.30)
local SizeOut = SGEffects:SizeFactor(Particle)
SizeOut.Completed:Connect(function()
Particle:Destroy()
end)
end))
task.wait(Rnum(0.1, 0.45))
end
- Custom Explosions.
Custom Explosion Code Example
local SGEffects = require(script.SGEffects)
SGEffects.Autoplay = true
local Part = Instance.new("Part")
Part.CFrame = CFrame.new(-12, 78, 156)
Part.Parent = workspace
local function CreateParticle(CF)
local Part = Instance.new("Part")
Part.Anchored = true
Part.Material = Enum.Material.Glass
Part.Size = Vector3.new(0.924, 0.879, 0.857)
Part.CFrame = CF
Part.Parent = workspace
return Part
end
local Exploded = false
Part.Touched:Connect(function()
if not Exploded then
Exploded = true
Part:Destroy()
for i = 1, 5 do
local Expl = Instance.new("Explosion")
Expl.Position = Part.Position
Expl.Parent = workspace
end
for i = 1, 300 do -- Ik its not accurate!
local Particle = CreateParticle(Part.CFrame)
SGEffects:ScatterOut(Particle, nil, {0, 80}, 0.4)
end
end
end)
task.wait(2)
Part.Anchored = false
- A Solar System Simulation
Solar System Simulation Code Example
local SGEffects = require(script.SGEffects)
SGEffects.Autoplay = true
local function CreatePlanetOrStar(Color, Material, CF, Size)
local Part = Instance.new("Part")
Part.Anchored = true
Part.Shape = Enum.PartType.Ball
Part.Color = Color
Part.Material = Material
Part.CFrame = CF
Part.Size = Size
Part.Parent = workspace
return Part
end
local Sun = CreatePlanetOrStar(BrickColor.new("Cool yellow").Color, Enum.Material.Neon, CFrame.new(-30, 25, 87), Vector3.new(4, 4, 4))
local Planets = 12
for i = 1, Planets do
local NewPlanet = CreatePlanetOrStar(BrickColor.Random().Color, Enum.Material.SmoothPlastic, Sun.CFrame, Vector3.new(1.32, 1.32, 1.32))
SGEffects.NonTweens:Orbit(NewPlanet, i * 5, i / 2)
end
And much more…
📜 Script:
Hope you enjoy the script! Or dislike it, feedback is always appreciated.