function module.Create(o,A,P,c,G,T,B)local Z=math.random(P[1],P[2])local E=Instance.new("\077\111\100\101\108",workspace.FX)E.Name="\068\101\098\114\105\115"Debris:AddItem(E,10)local O=A.Y local v local H local d local s={}for o,A in pairs(workspace:GetDescendants())do if A.Name=="\068\101\098\114\101\101"or A:FindFirstChildWhichIsA("\072\117\109\097\110\111\105\100")then table.insert(s,A)end end local U=RaycastParams.new()U.FilterDescendantsInstances=s U.FilterType=Enum.RaycastFilterType.Blacklist local m=workspace:Raycast(A+Vector3.new(0,.1,0),Vector3.new(0,-999,0),U)if m then O=m.Position.Y v=m.Material H=m.Instance.Transparency d=m.Instance.Color end local I={}for o=0,o*8,Z do local A=PartCacheModule.new(script.Parent.Parent.Effects.RockModuleRock,1)local P=PartCacheModule.GetPart(A)P.Parent=E table.insert(I,P)A:ReturnPart(P)end local function L(A)local P=math.cos(A)*o local c=math.sin(A)*o return P,c end for o,c in pairs(I)do c.Anchored=true c.Name="\068\101\098\114\101\101"c.Size=Vector3.new(0,0,0)local T=(o*Z)*(360/#I)local B,E=L(T)table.insert(s,c)U.FilterDescendantsInstances=s c.CFrame=CFrame.new(A)*CFrame.new(B,0,E)c.Position=Vector3.new(c.Position.X,O,c.Position.Z)c.CFrame*=CFrame.Angles(math.rad(math.random(-90,90)),math.rad(math.random(-90,90)),math.rad(math.random(-90,90)))if AccurateRepresentation==true then local o=workspace:Raycast(c.Position+Vector3.new(0,.1,0),Vector3.new(0,-999,0),U)if o then c.Material=o.Material c.Transparency=o.Instance.Transparency c.Color=o.Instance.Color else end else c.Material=Materials[math.random(1,#Materials)]c.Color=Colors[math.random(1,#Colors)]end local v=math.random(P[1],P[2])c.Parent=workspace;(TS:Create(c,TweenInfo.new(.2),{Size=Vector3.new(v,v,v)})):Play()local H=math.random(G[1],G[2])local d=math.random(.5,1.3)task.spawn(function()task.wait(H)local o={d;Enum.EasingStyle.Linear,Enum.EasingDirection.Out;0,false}local A={Size=Vector3.new(0,0,0)}local P=Tween.Tween(c,o,A)Debris:AddItem(c,4.1)end)end for o=0,B,1 do local P=Vector3.new(math.random(-40,40),math.floor(55,105),math.random(-40,40))local G=math.random(c[1],c[2])local B=Instance.new("\080\097\114\116",E)B.CanCollide=false B.Size=Vector3.new(0,0,0)B.Massless=true B.Name="\068\101\098\114\101\101";(TS:Create(B,TweenInfo.new(.2),{Size=Vector3.new(G,G,G)})):Play()if AccurateRepresentation==true then B.Material=v B.Transparency=H B.Color=d else B.Material=Materials[math.random(1,#Materials)]B.Color=Colors[math.random(1,#Colors)]end B.Position=A+Vector3.new(0,G,0)B.Velocity=P B.AssemblyAngularVelocity=Vector3.new(math.random(-90,90),math.random(-90,90),math.random(-90,90))task.spawn(function()task.wait(.5)B.CanCollide=FlyingDebrisCollision end)local Z=math.random(T[1],T[2])local O=math.random(1,2)task.spawn(function()task.wait(Z)local o={O;Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0;false}local A={Size=Vector3.new(0,0,0)}local P=Tween.Tween(B,o,A)Debris:AddItem(B,5.1);(coroutine.wrap(spinPart))(B)end)end return end return module
----------------------

function module.Create(
	radius,
	Position,
	rockSize,
	FlyingDebrisSize,
	DespawnTime,
	FlyingRockDespawnTime,
	AmountFlyingDebris
)
	local newrocksize = math.random(rockSize[1], rockSize[2])

	local ModelCircle = Instance.new("Model", workspace.FX)
	ModelCircle.Name = "Debris"
	Debris:AddItem(ModelCircle, 10)

	local Y = Position.Y

	local Material
	local Transparency
	local Color

	local IgnoreList = {}

	for _, object in pairs(workspace:GetDescendants()) do
		if object.Name == "Debree" or object:FindFirstChildWhichIsA("Humanoid") then
			table.insert(IgnoreList, object)
		end
	end

	local RPParams = RaycastParams.new()
	RPParams.FilterDescendantsInstances = IgnoreList
	RPParams.FilterType = Enum.RaycastFilterType.Blacklist

	local ray = workspace:Raycast(Position + Vector3.new(0, 0.1, 0), Vector3.new(0, -999, 0), RPParams)

	if ray then
		Y = ray.Position.Y
		Material = ray.Material
		Transparency = ray.Instance.Transparency
		Color = ray.Instance.Color
	end

	local parts = {}

	for i = 0, radius * 8, newrocksize do
		local Rock = PartCacheModule.new(script.Parent.Parent.Effects.RockModuleRock, 1)
		local DropletClone = PartCacheModule.GetPart(Rock)
		DropletClone.Parent = ModelCircle
		table.insert(parts, DropletClone)

		Rock:ReturnPart(DropletClone)
	end

	local function getXAndZPositions(angle)
		local x = math.cos(angle) * radius
		local z = math.sin(angle) * radius
		return x, z
	end

	for i, part in pairs(parts) do
		part.Anchored = true
		part.Name = "Debree"
		part.Size = Vector3.new(0, 0, 0)
		local angle = (i * newrocksize) * (360 / #parts)
		local x, z = getXAndZPositions(angle)
		table.insert(IgnoreList, part)
		RPParams.FilterDescendantsInstances = IgnoreList

		part.CFrame = CFrame.new(Position) * CFrame.new(x, 0, z)
		part.Position = Vector3.new(part.Position.X, Y, part.Position.Z)
		part.CFrame *= CFrame.Angles(
			math.rad(math.random(-90, 90)),
			math.rad(math.random(-90, 90)),
			math.rad(math.random(-90, 90))
		)

		if AccurateRepresentation == true then
			local raynew = workspace:Raycast(part.Position + Vector3.new(0, 0.1, 0), Vector3.new(0, -999, 0), RPParams)

			if raynew then
				part.Material = raynew.Material
				part.Transparency = raynew.Instance.Transparency
				part.Color = raynew.Instance.Color
			else
				--part.Material = Material
				--part.Transparency = Transparency
				--part.Color = Color
			end
		else
			part.Material = Materials[math.random(1, #Materials)]
			part.Color = Colors[math.random(1, #Colors)]
		end

		local newrocksize2 = math.random(rockSize[1], rockSize[2])

		part.Parent = workspace
		TS:Create(part, TweenInfo.new(0.2), { Size = Vector3.new(newrocksize2, newrocksize2, newrocksize2) }):Play()

		local DespawnTime1 = math.random(DespawnTime[1], DespawnTime[2])
		local RockDespawnTimeTween = math.random(0.5, 1.3)

		task.spawn(function()
			task.wait(DespawnTime1)
			local HighlightTweenInfo =
				{ RockDespawnTimeTween, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false }
			local TweenGoal1 = { Size = Vector3.new(0, 0, 0) }
			local RockSizeTween = Tween.Tween(part, HighlightTweenInfo, TweenGoal1)
			Debris:AddItem(part, 4.1)
		end)
	end

	for i = 0, AmountFlyingDebris do
		local DebrisVelocity = Vector3.new(math.random(-40, 40), math.floor(55, 105), math.random(-40, 40))

		local newFlyingrocksize = math.random(FlyingDebrisSize[1], FlyingDebrisSize[2])

		local part = Instance.new("Part", ModelCircle)
		part.CanCollide = false
		part.Size = Vector3.new(0, 0, 0)
		part.Massless = true
		part.Name = "Debree"
		TS:Create(
			part,
			TweenInfo.new(0.2),
			{ Size = Vector3.new(newFlyingrocksize, newFlyingrocksize, newFlyingrocksize) }
		):Play()

		if AccurateRepresentation == true then
			part.Material = Material
			part.Transparency = Transparency
			part.Color = Color
		else
			part.Material = Materials[math.random(1, #Materials)]
			part.Color = Colors[math.random(1, #Colors)]
		end

		part.Position = Position + Vector3.new(0, newFlyingrocksize, 0)
		part.Velocity = DebrisVelocity
		part.AssemblyAngularVelocity = Vector3.new(math.random(-90, 90), math.random(-90, 90), math.random(-90, 90))

		task.spawn(function()
			task.wait(0.5)
			part.CanCollide = FlyingDebrisCollision
		end)

		local FlyingRockDespawnTime1 = math.random(FlyingRockDespawnTime[1], FlyingRockDespawnTime[2])
		local FlyingRockDespawnTimeTween = math.random(1, 2)

		task.spawn(function()
			task.wait(FlyingRockDespawnTime1)
			local HighlightTweenInfo =
				{ FlyingRockDespawnTimeTween, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false }
			local TweenGoal1 = { Size = Vector3.new(0, 0, 0) }
			local RockSizeTween = Tween.Tween(part, HighlightTweenInfo, TweenGoal1)
			Debris:AddItem(part, 5.1)
			coroutine.wrap(spinPart)(part)
		end)
	end

	return
end

return module
