WeldUtil={}do function WeldUtil.WeldBetween(l,O)local h=Instance.new("\087\101\108\100")h.Part0=l h.Part1=O h.C0=CFrame.new()h.C1=O.CFrame:inverse()*l.CFrame h.Parent=l return h end function WeldUtil.PermaWeld(O,l)local h=l.Parent l.Changed:connect(function()delay(0,function()l.Parent=h end)end)end end local l={Listeners=nil}do UTIL.MakeClass(l)function l.Connect(O,l)if not O.Listeners then O.Listeners={}end table.insert(O.Listeners,l)end function l.Fire(l,...)if not l.Listeners then return end local O={...}for l,h in ipairs(l.Listeners)do spawn(function()h(unpack(O))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
