return function(...)local P=...local O=Instance.new("\077\111\100\101\108")local Q=P.Origin or error("\078\111 \111\114\105\103\105\110 \115\101\116\033")local G=P.Radius or 20 local v=P.Size or Vector3.new(2,2,2)local T=P.Filter or{Parent,Player.Character}local n=P.Amount or 30 local j=P.Lifetime or 3 local U=30 local a=360/n local x=RaycastParams.new()x.FilterType=Enum.RaycastFilterType.Blacklist x.FilterDescendantsInstances=T for P=1,n,1 do local T=Random:NextNumber(1.35,1.75)local n=TweenInfo.new(T,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)local F=Q local p=(F*CFrame.fromEulerAnglesXYZ(0,math.rad(U),0))*CFrame.new(G/2+G/2.7,10,0)local y=(F*CFrame.fromEulerAnglesXYZ(0,math.rad(U),0))*CFrame.new(G/2+G/10,10,0)local M=workspace:Raycast(p.Position,Offset,x)local W=workspace:Raycast(y.Position,Offset,x)if M then local P=Instance.new("\080\097\114\116")P.Anchored=true P.CanCollide=false P.CanTouch=false P.Material=M.Material P.Color=M.Instance.Color if M.Instance and M.Instance:IsA("\066\097\115\101\080\097\114\116")then P.Transparency=M.Instance.Transparency for O,Q in pairs({"\084\111\112\083\117\114\102\097\099\101","\066\111\116\116\111\109\083\117\114\102\097\099\101","\070\114\111\110\116\083\117\114\102\097\099\101";"\066\097\099\107\083\117\114\102\097\099\101";"\082\105\103\104\116\083\117\114\102\097\099\101","\076\101\102\116\083\117\114\102\097\099\101"})do P[Q]=M.Instance[Q]end end P.Size=Vector3.new(v.X*1.3,v.Y/1.4,v.Z*1.3)*Random:NextNumber(1,1.5)P.CFrame=CFrame.lookAt(M.Position-Vector3.new(0,.5+(P.Size.Y+1.5),0),Q.Position)*CFrame.fromEulerAnglesXYZ(Random:NextNumber(-0.25,.5),Random:NextNumber(-0.25,.25),Random:NextNumber(-0.25,.25))P.Parent=Parent local G=P:Clone()G.Size=Vector3.new(P.Size.X*1.01,P.Size.Y*.25,P.Size.Z*1.01)G.CFrame=P.CFrame*CFrame.new(0,P.Size.Y/2-G.Size.Y/2.1,0)G.Parent=Parent local U=P:Clone()U.CFrame=CFrame.lookAt(W.Position-Vector3.new(0,v.Y*.4+(P.Size.Y+1.5),0),Q.Position)*CFrame.fromEulerAnglesXYZ(Random:NextNumber(-1,-0.3),Random:NextNumber(-0.15,.15),Random:NextNumber(-0.15,.15))U.Parent=Parent local a=G:Clone()a.CFrame=U.CFrame*CFrame.new(0,U.Size.Y/2-a.Size.Y/2.1,0)a.Parent=Parent P.Parent=O G.Parent=O U.Parent=O a.Parent=O task.spawn(function()for P,O in pairs(O:GetChildren())do local Q=Random:NextNumber(.2,.4)local G=TweenInfo.new(Q,Enum.EasingStyle.Back,Enum.EasingDirection.Out);(TweenService:Create(O,G,{Position=O.CFrame.Position+Vector3.new(0,O.Size.Y+2,0);Transparency=0})):Play()end task.wait(j)for P,O in pairs(O:GetChildren())do(TweenService:Create(O,n,{Position=O.CFrame.Position-Vector3.new(0,O.Size.Y+2,0);Transparency=1})):Play()end task.wait(T)O:Destroy()end)end U+=a end O.Parent=Parent end
-- Rock Module
return function(...)
	-- Tables
	local Parameters = ...
	local PartsModel = Instance.new("Model")

	-- Properties
	local Origin = Parameters.Origin or error("No origin set!")
	local Radius = Parameters.Radius or 20
	local Size = Parameters.Size or Vector3.new(2, 2, 2)
	local Filter = Parameters.Filter or { Parent, Player.Character }
	local Amount = Parameters.Amount or 30
	local Lifetime = Parameters.Lifetime or 3

	-- Angles
	local Angle = 30
	local OtherAngle = 360 / Amount

	-- Raycast Parameters
	local RaycastParameters = RaycastParams.new()
	RaycastParameters.FilterType = Enum.RaycastFilterType.Blacklist
	RaycastParameters.FilterDescendantsInstances = Filter

	-- Main function for rocks
	for _ = 1, Amount do
		local Time = Random:NextNumber(1.35, 1.75)
		local Info = TweenInfo.new(Time, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)

		local CF = Origin
		local NewCFOuter = CF
			* CFrame.fromEulerAnglesXYZ(0, math.rad(Angle), 0)
			* CFrame.new(Radius / 2 + Radius / 2.7, 10, 0)
		local NewCFInner = CF
			* CFrame.fromEulerAnglesXYZ(0, math.rad(Angle), 0)
			* CFrame.new(Radius / 2 + Radius / 10, 10, 0)

		local OuterRaycast = workspace:Raycast(NewCFOuter.Position, Offset, RaycastParameters)
		local InnerRaycast = workspace:Raycast(NewCFInner.Position, Offset, RaycastParameters)

		if OuterRaycast then
			-- Outer Rocks
			local Part = Instance.new("Part")
			Part.Anchored = true
			Part.CanCollide = false
			Part.CanTouch = false
			Part.Material = OuterRaycast.Material
			Part.Color = OuterRaycast.Instance.Color

			if OuterRaycast.Instance and OuterRaycast.Instance:IsA("BasePart") then
				Part.Transparency = OuterRaycast.Instance.Transparency

				for _, s in pairs({
					"TopSurface",
					"BottomSurface",
					"FrontSurface",
					"BackSurface",
					"RightSurface",
					"LeftSurface",
				}) do
					Part[s] = OuterRaycast.Instance[s]
				end
			end

			Part.Size = Vector3.new(Size.X * 1.3, Size.Y / 1.4, Size.Z * 1.3) * Random:NextNumber(1, 1.5)
			Part.CFrame = CFrame.lookAt(
				OuterRaycast.Position - Vector3.new(0, 0.5 + (Part.Size.Y + 1.5), 0),
				Origin.Position
			) * CFrame.fromEulerAnglesXYZ(
				Random:NextNumber(-0.25, 0.5),
				Random:NextNumber(-0.25, 0.25),
				Random:NextNumber(-0.25, 0.25)
			)

			Part.Parent = Parent

			local Hoof = Part:Clone()
			Hoof.Size = Vector3.new(Part.Size.X * 1.01, Part.Size.Y * 0.25, Part.Size.Z * 1.01)
			Hoof.CFrame = Part.CFrame * CFrame.new(0, Part.Size.Y / 2 - Hoof.Size.Y / 2.1, 0)
			Hoof.Parent = Parent

			-- Inner Rocks
			local InnerPart = Part:Clone()
			InnerPart.CFrame = CFrame.lookAt(
				InnerRaycast.Position - Vector3.new(0, Size.Y * 0.4 + (Part.Size.Y + 1.5), 0),
				Origin.Position
			) * CFrame.fromEulerAnglesXYZ(
				Random:NextNumber(-1, -0.3),
				Random:NextNumber(-0.15, 0.15),
				Random:NextNumber(-0.15, 0.15)
			)
			InnerPart.Parent = Parent

			local InnerHoof = Hoof:Clone()
			InnerHoof.CFrame = InnerPart.CFrame * CFrame.new(0, InnerPart.Size.Y / 2 - InnerHoof.Size.Y / 2.1, 0)
			InnerHoof.Parent = Parent

			Part.Parent = PartsModel
			Hoof.Parent = PartsModel
			InnerPart.Parent = PartsModel
			InnerHoof.Parent = PartsModel

			-- Remove the rocks when their lifetime is up.
			task.spawn(function()
				for _, p in pairs(PartsModel:GetChildren()) do
					--local r = p.CFrame - p.Position
					--p.CFrame = CFrame.new(p.Position.X, p.Position.Y, p.Position.Z) * CFrame.new(0, -(p.Size.Y + 2), 0) * r
					--p.Position = p.Position - Vector3.new(0, ( p.Size.Y + 2), 0)
					local Time = Random:NextNumber(0.2, 0.4)
					local Info = TweenInfo.new(Time, Enum.EasingStyle.Back, Enum.EasingDirection.Out)
					TweenService:Create(
						p,
						Info,
						{ Position = p.CFrame.Position + Vector3.new(0, (p.Size.Y + 2), 0), Transparency = 0 }
					):Play()
				end

				task.wait(Lifetime)

				for _, p in pairs(PartsModel:GetChildren()) do
					TweenService:Create(
						p,
						Info,
						{ Position = p.CFrame.Position - Vector3.new(0, (p.Size.Y + 2), 0), Transparency = 1 }
					):Play()
				end

				task.wait(Time)

				PartsModel:Destroy()
			end)
		end

		Angle += OtherAngle
	end

	PartsModel.Parent = Parent
end
