function Basic.ScaleModelWithJoints(z,h)local U=z.PrimaryPart.Position for U,k in ipairs(z:GetDescendants())do if k:IsA("\066\097\115\101\080\097\114\116")then k.Size=k.Size*h local U=k.Position-(z:GetPrimaryPartCFrame()).p local V=k.CFrame-k.Position k.CFrame=CFrame.new((z:GetPrimaryPartCFrame()).p+U*h)*V elseif k:IsA("\083\112\101\099\105\097\108\077\101\115\104")and k.MeshType==Enum.MeshType.FileMesh then k.Scale=k.Scale*h elseif k:IsA("\074\111\105\110\116\073\110\115\116\097\110\099\101")then local z=k.C0.p*h local U,V,b=k.C0:ToEulerAnglesXYZ()local g=k.C1.p*h local l,e,r=k.C1:ToEulerAnglesXYZ()k.C0=CFrame.new(z)*CFrame.Angles(U,V,b)k.C1=CFrame.new(g)*CFrame.Angles(l,e,r)end end return z end function Basic.Destroy(z)if not z then return end z:Destroy()end return Basic
-- @Description Resize a specific %Model to a larger %Scale multiplier
-- @Arg1 Model
-- @Arg2 Scale
function Basic.ScaleModelWithJoints(model, scale)
	local origin = model.PrimaryPart.Position

	for _, obj in ipairs(model:GetDescendants()) do
		if obj:IsA("BasePart") then
			obj.Size = obj.Size * scale

			local distance = (obj.Position - model:GetPrimaryPartCFrame().p)
			local rotation = (obj.CFrame - obj.Position)
			obj.CFrame = (CFrame.new(model:GetPrimaryPartCFrame().p + distance * scale) * rotation)
		elseif obj:IsA("SpecialMesh") and obj.MeshType == Enum.MeshType.FileMesh then
			obj.Scale = obj.Scale * scale
		elseif obj:IsA("JointInstance") then
			local c0NewPos = obj.C0.p * scale
			local c0RotX, c0RotY, c0RotZ = obj.C0:ToEulerAnglesXYZ()

			local c1NewPos = obj.C1.p * scale
			local c1RotX, c1RotY, c1RotZ = obj.C1:ToEulerAnglesXYZ()

			obj.C0 = CFrame.new(c0NewPos) * CFrame.Angles(c0RotX, c0RotY, c0RotZ)
			obj.C1 = CFrame.new(c1NewPos) * CFrame.Angles(c1RotX, c1RotY, c1RotZ)
		end
	end

	return model
end

function Basic.Destroy(obj)
	if not obj then
		return
	end
	obj:Destroy()
end

return Basic
