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

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
