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