------------------------------------------------------------------------------
--------------------[ FUNCTIONS ]---------------------------------------------
------------------------------------------------------------------------------


local CreateShockwave = function(Center, Radius)
	local Shockwave = Instance.new("Part")
	Shockwave.BrickColor = S.ShockwaveColor
	Shockwave.Material = Enum.Material.SmoothPlastic
	Shockwave.Name = "Shockwave"
	Shockwave.Anchored = true
	Shockwave.CanCollide = false
	Shockwave.FormFactor = Enum.FormFactor.Symmetric
	Shockwave.Size = VEC3(1, 1, 1)
	Shockwave.BottomSurface = Enum.SurfaceType.Smooth
	Shockwave.TopSurface = Enum.SurfaceType.Smooth
	local Mesh = Instance.new("SpecialMesh")
	Mesh.MeshType = Enum.MeshType.Sphere
	Mesh.Scale = VEC3()
	Mesh.Parent = Shockwave
	Shockwave.Parent = Main.Parent
	Shockwave.CFrame = CF(Center)
	spawn(function()
		for i = 0, 1, 1 / (30 * S.ShockwaveDuration) do
			local Scale = 2 * Radius * i
			Mesh.Scale = VEC3(Scale, Scale, Scale)
			Shockwave.Transparency = i
			wait()
		end
		Shockwave:Destroy()
	end)
end

local RAND = function(Min, Max, Accuracy)
	local Inverse = 1 / (Accuracy or 1)
	return (math.random(Min * Inverse, Max * Inverse) / Inverse)
end

local NumLerp = function(A, B, Alpha)
	return A + (B - A) * Alpha
end

local Sine = function(Alpha)
	return math.sin(math.rad(Alpha))
end

local IsIgnored = function(Obj)
	for _,v in pairs(Ignore) do
		if Obj == v or Obj:IsDescendantOf(v) then
			return true
		end
	end
	return false
end
