local Q=os.clock function DiscretePulse(Q,T,S,w,t,j,A)return math.clamp(S/(2*w)-math.abs(((Q-t*T)+.5*S)/w),j,A)end function NoiseBetween(Q,T,S,w,t)return w+(t-w)*(math.noise(Q,T,S)+.5)end function CubicBezier(Q,T,S,w,t)return((Q*(1-t)^3+((T*3)*t)*(1-t)^2)+((S*3)*(1-t))*t^2)+w*t^3 end local T=Instance.new("\080\097\114\116")T.TopSurface,T.BottomSurface=0,0 T.Anchored,T.CanCollide=true,false T.Shape="\067\121\108\105\110\100\101\114"T.Name="\066\111\108\116\080\097\114\116"T.Material=Enum.Material.Neon T.Color=Color3.new(1,1,1)T.Transparency=1 local S=Random.new()local w=(CFrame.lookAt(Vector3.new(),Vector3.new(1,0,0))):inverse()local t={}local j={}j.__index=j
--Procedural Lightning Module. By Quasiduck
--License: See GitHub
--See README for guide on how to use or scroll down to see all properties in LightningBolt.new
--All properties update in real-time except PartCount which requires a new LightningBolt to change
--i.e. You can change a property at any time and it will still update the look of the bolt

local clock = os.clock

function DiscretePulse(input, s, k, f, t, min, max) --input should be between 0 and 1. See https://www.desmos.com/calculator/hg5h4fpfim for demonstration.
	return math.clamp(k / (2 * f) - math.abs((input - t * s + 0.5 * k) / f), min, max)
end

function NoiseBetween(x, y, z, min, max)
	return min + (max - min) * (math.noise(x, y, z) + 0.5)
end

function CubicBezier(p0, p1, p2, p3, t)
	return p0 * (1 - t) ^ 3 + p1 * 3 * t * (1 - t) ^ 2 + p2 * 3 * (1 - t) * t ^ 2 + p3 * t ^ 3
end

local BoltPart = Instance.new("Part")
BoltPart.TopSurface, BoltPart.BottomSurface = 0, 0
BoltPart.Anchored, BoltPart.CanCollide = true, false
BoltPart.Shape = "Cylinder"
BoltPart.Name = "BoltPart"
BoltPart.Material = Enum.Material.Neon
BoltPart.Color = Color3.new(1, 1, 1)
BoltPart.Transparency = 1

local rng = Random.new()
local xInverse = CFrame.lookAt(Vector3.new(), Vector3.new(1, 0, 0)):inverse()

local ActiveBranches = {}

local LightningBolt = {}
LightningBolt.__index = LightningBolt
