WeldUtil={}do function WeldUtil.WeldBetween(I,j)local b=Instance.new("\087\101\108\100")b.Part0=I b.Part1=j b.C0=CFrame.new()b.C1=j.CFrame:inverse()*I.CFrame b.Parent=I return b end function WeldUtil.PermaWeld(j,I)local b=I.Parent I.Changed:connect(function()Delay(0,function()I.Parent=b end)end)end end local I={Listeners=nil}do UTIL.MakeClass(I)function I.Connect(j,I)if not j.Listeners then j.Listeners={}end table.insert(j.Listeners,I)end function I.Fire(I,...)if not I.Listeners then return end local j={...}for I,b in ipairs(I.Listeners)do Spawn(function()b(unpack(j))end)end end end
--
--All Welding Related Utility functions should be put here
--
WeldUtil = {}

do
	function WeldUtil.WeldBetween(a, b)
		local weld = Instance.new("Weld")
		weld.Part0 = a
		weld.Part1 = b
		weld.C0 = CFrame.new()
		weld.C1 = b.CFrame:inverse() * a.CFrame

		weld.Parent = a
		return weld
	end

	function WeldUtil:PermaWeld(weld)
		local OriginalParent = weld.Parent
		weld.Changed:connect(function()
			Delay(0, function()
				weld.Parent = OriginalParent
			end)
		end)
	end
end

local InternalEvent = {
	Listeners = nil,
}
do
	UTIL.MakeClass(InternalEvent)
	function InternalEvent:Connect(func)
		if not self.Listeners then
			self.Listeners = {}
		end
		table.insert(self.Listeners, func)
	end
	function InternalEvent:Fire(...)
		if not self.Listeners then
			return
		end
		local args = { ... }
		for _, i in ipairs(self.Listeners) do
			Spawn(function()
				i(unpack(args))
			end)
		end
	end
end
