local h={}h.__index={}function h.new()return setmetatable({connections={}},h)end function h.Connect(F,h)F.connections[h]=h local m=function()F.connections[h]=nil end return m end function h.Fire(h,...)for h,F in pairs(h.connections)do F(...)end end return h


local Signal = {}
Signal.__index = {}

function Signal.new()
	return setmetatable({connections = {}}, Signal)
end

function Signal:Connect(func)
	self.connections[func] = func

	local disconnect = function()
		self.connections[func] = nil
	end

	return disconnect
end

function Signal:Fire(...)
	for _, func in pairs(self.connections) do
		func(...)
	end
end

return Signal
