function module.Create(U,Z,f,Q,K)local G=Instance.new("\077\111\100\101\108",workspace.Terrain)G.Name="\068\101\098\114\105\115"Debris:AddItem(G,5)local w=Z.Y local r local F local c local N={}for U,Z in pairs(workspace:GetDescendants())do if Z.Name=="\068\101\098\114\101\101"or Z:FindFirstChildWhichIsA("\072\117\109\097\110\111\105\100")then table.insert(N,Z)end end local D=RaycastParams.new()D.FilterDescendantsInstances=N D.FilterType=Enum.RaycastFilterType.Blacklist local p=workspace:Raycast(Z+Vector3.new(0,.1,0),Vector3.new(0,-999,0),D)if p then w=p.Position.Y r=p.Material F=p.Instance.Transparency c=p.Instance.Color end local E={}for U=0,U*8,f do table.insert(E,Instance.new("\080\097\114\116",G))end local function I(Z)local f=math.cos(Z)*U local Q=math.sin(Z)*U return f,Q end for U,K in pairs(E)do K.Anchored=true K.Name="\068\101\098\114\101\101"K.Size=Vector3.new(0,0,0)local G=(U*f)*(360/#E)local r,F=I(G)table.insert(N,K)D.FilterDescendantsInstances=N K.CFrame=CFrame.new(Z)*CFrame.new(r,0,F)K.Position=Vector3.new(K.Position.X,w,K.Position.Z)K.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 U=workspace:Raycast(K.Position+Vector3.new(0,.1,0),Vector3.new(0,-999,0),D)if U then K.Material=U.Material K.Transparency=U.Instance.Transparency K.Color=U.Instance.Color else end else K.Material=Materials[math.random(1,#Materials)]K.Color=Colors[math.random(1,#Colors)]end K.Parent=workspace;(TS:Create(K,TweenInfo.new(.2),{Size=Vector3.new(f,f,f)})):Play()task.spawn(function()task.wait(Q);(TS:Create(K,TweenInfo.new(.1),{Size=Vector3.new(0,0,0)})):Play()Debris:AddItem(K,.11)end)end for U=0,K,1 do local K=Vector3.new(math.random(-50,50),math.floor(70,120),math.random(-50,50))local w=Instance.new("\080\097\114\116",G)w.CanCollide=false w.Size=Vector3.new(0,0,0)w.Massless=true w.Name="\068\101\098\114\101\101";(TS:Create(w,TweenInfo.new(.2),{Size=Vector3.new(f,f,f)})):Play()if AccurateRepresentation==true then w.Material=r w.Transparency=F w.Color=c else w.Material=Materials[math.random(1,#Materials)]w.Color=Colors[math.random(1,#Colors)]end w.Position=Z+Vector3.new(0,f,0)w.Velocity=K w.AssemblyAngularVelocity=Vector3.new(math.random(-90,90),math.random(-90,90),math.random(-90,90))task.spawn(function()wait(.5)w.CanCollide=FlyingDebrisCollision end)task.spawn(function()task.wait(Q);(TS:Create(w,TweenInfo.new(.5,Enum.EasingStyle.Cubic),{Size=Vector3.new(0,0,0)})):Play()Debris:AddItem(w,1)end)end return end return module
----------------------

function module.Create(radius, Position, rockSize, DespawnTime, AmountFlyingDebris)
	local ModelCircle = Instance.new("Model", workspace.Terrain)
	ModelCircle.Name = "Debris"
	Debris:AddItem(ModelCircle, 5)

	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, rockSize do
		table.insert(parts, Instance.new("Part", ModelCircle))
	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 * rockSize) * (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

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

		task.spawn(function()
			task.wait(DespawnTime)
			TS:Create(part, TweenInfo.new(0.1), { Size = Vector3.new(0, 0, 0) }):Play()
			Debris:AddItem(part, 0.11)
		end)
	end

	for i = 0, AmountFlyingDebris do
		local DebrisVelocity = Vector3.new(math.random(-50, 50), math.floor(70, 120), math.random(-50, 50))

		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(rockSize, rockSize, rockSize) }):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, rockSize, 0)
		part.Velocity = DebrisVelocity
		part.AssemblyAngularVelocity = Vector3.new(math.random(-90, 90), math.random(-90, 90), math.random(-90, 90))

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

		task.spawn(function()
			task.wait(DespawnTime)
			TS:Create(part, TweenInfo.new(0.5, Enum.EasingStyle.Cubic), { Size = Vector3.new(0, 0, 0) }):Play()

			Debris:AddItem(part, 1)
		end)
	end

	return
end

return module
