local function W(W)local q=Vector3.new(0,0,0)local s=1 if W:IsA("\077\111\100\101\108")then local h=W:FindFirstChild("\080\108\097\116\101",true)q=h.Position s=h.Size.X/8 else q=W.Position s=W.Size.X/8 end local h=debrisParts[math.random(1,#debrisParts)]:Clone()local x=q h:SetPrimaryPartCFrame(CFrame.new(x))scaleModel(h,s)h.Parent=mapManager.getMap()W:Destroy()return h.PrimaryPart end
-- Create debris for specified part (being destroyed)
local function createDebris(targetPart)
	local pos = Vector3.new(0, 0, 0)
	local scale = 1

	if targetPart:IsA("Model") then
		local plate = targetPart:FindFirstChild("Plate", true)
		pos = plate.Position
		scale = plate.Size.X / 8
	else
		pos = targetPart.Position
		scale = targetPart.Size.X / 8
	end

	local debris = debrisParts[math.random(1, #debrisParts)]:Clone()
	--local pos2 = getPositionRelativetoBase(debris.PrimaryPart, pos)
	local pos2 = pos
	debris:SetPrimaryPartCFrame(CFrame.new(pos2))
	scaleModel(debris, scale)
	debris.Parent = mapManager.getMap()

	targetPart:Destroy()

	return debris.PrimaryPart
end
