local function e(e)local S={Model=nil;Outline=nil,Parts={}}local c=ITEMS[e.Name]:Clone()c.Parent=EFFECTS c:BreakJoints()local Y=require(c:WaitForChild("\067\111\110\102\105\103"))local R=ITEMS[e.Name]if R:FindFirstChild("\065\116\116\097\099\104\109\101\110\116\115")then local S=e:WaitForChild("\065\116\116\097\099\104\109\101\110\116\115")for e,S in pairs(S:GetChildren())do local Y=ITEMS[S.Name]:Clone()local R=require(Y.Config)Y:SetPrimaryPartCFrame((c.PrimaryPart.CFrame*c.PrimaryPart[R.Attach.."\065\116\116\097\099\104"].CFrame)*Y.PrimaryPart.Attach.CFrame:inverse())Y.Parent=c Y:BreakJoints()end end local w=Instance.new("\077\111\100\101\108")w.Name="\079\117\116\108\105\110\101"w.Parent=EFFECTS S.Model=c S.Outline=w local f=c.PrimaryPart:FindFirstChild("\067\101\110\116\101\114")for e,Y in pairs(c:GetDescendants())do if Y:IsA("\066\097\115\101\080\097\114\116")then Y.CFrame=CFrame.new(0,-100,0)Y.Anchored=true Y.CanCollide=false local e=Y:Clone()e.Name="\079\117\116\108\105\110\101"e.Material=Enum.Material.Neon e.Color=OUTLINE_COLOR e.Size=e.Size+Vector3.new(OUTLINE_WIDTH,OUTLINE_WIDTH,OUTLINE_WIDTH)if e:IsA("\077\101\115\104\080\097\114\116")then e.TextureID=""end e.Parent=w local R={Part=Y,Outline=e;Offset=CFrame.new()}if f then R.Offset=f.WorldCFrame:toObjectSpace(Y.CFrame)else R.Offset=c.PrimaryPart.CFrame:toObjectSpace(Y.CFrame)end table.insert(S.Parts,R)end end drops[e]=S e.AncestryChanged:connect(function()if e.Parent~=DROPS then if drops[e]then drops[e].Model:Destroy()drops[e].Outline:Destroy()drops[e]=nil end end end)end


local function HandleDrop(d)
	local drop	= {
		Model	= nil;
		Outline	= nil;
		Parts	= {};
	}
	
	local model	= ITEMS[d.Name]:Clone()
		model.Parent	= EFFECTS
		model:BreakJoints()
		
	local config	= require(model:WaitForChild("Config"))
	local base		= ITEMS[d.Name]
	
	if base:FindFirstChild("Attachments") then
		local attachments	= d:WaitForChild("Attachments")
		
		for _, attach in pairs(attachments:GetChildren()) do
			local attachment	= ITEMS[attach.Name]:Clone()
			local config		= require(attachment.Config)
			attachment:SetPrimaryPartCFrame(model.PrimaryPart.CFrame * model.PrimaryPart[config.Attach .. "Attach"].CFrame * attachment.PrimaryPart.Attach.CFrame:inverse())
			attachment.Parent	= model
			attachment:BreakJoints()
		end
	end
	
	local outline	= Instance.new("Model")
		outline.Name	= "Outline"
		outline.Parent	= EFFECTS
		
	drop.Model		= model
	drop.Outline	= outline
				
	local center	= model.PrimaryPart:FindFirstChild("Center")
	
	for _, v in pairs(model:GetDescendants()) do
		if v:IsA("BasePart") then
			v.CFrame		= CFrame.new(0, -100, 0)
			v.Anchored		= true
			v.CanCollide	= false
		
			local o	= v:Clone()
				o.Name		= "Outline"
				o.Material	= Enum.Material.Neon
				o.Color		= OUTLINE_COLOR
				o.Size		= o.Size + Vector3.new(OUTLINE_WIDTH, OUTLINE_WIDTH, OUTLINE_WIDTH)
				if o:IsA("MeshPart") then
					o.TextureID	= ""
				end
				o.Parent	= outline
		
			local info	= {
				Part		= v;
				Outline		= o;
				Offset		= CFrame.new();
			}
			
			if center then
				info.Offset	= center.WorldCFrame:toObjectSpace(v.CFrame)
			else
				info.Offset	= model.PrimaryPart.CFrame:toObjectSpace(v.CFrame)
			end
			
			table.insert(drop.Parts, info)
		end
	end
	
	drops[d]	= drop
	
	d.AncestryChanged:connect(function()
		if d.Parent ~= DROPS then
			if drops[d] then
				drops[d].Model:Destroy()
				drops[d].Outline:Destroy()
				drops[d]	= nil
			end
		end
	end)
end
