function Cooldown.new(t,o)local n=tick()local P={_endTick=n+t}setmetatable(P,{__index=Cooldown})if o then delay(t,o)end return P end function Cooldown.hasExpired(t)return t._endTick<tick()and true or false end return Cooldown
--[[
	Creates a new cooldown, with specified cooldownTime. cooldown:hasExpired returns true or false depending on if the cooldown has expired or not. There
	is also an optional callbackFunction that will be called as soon as the cooldown expires.
]]
function Cooldown.new(cooldownTime, callbackFunction)
	local startTick = tick()

	local cooldownObject = {
		_endTick = startTick + cooldownTime,
	}
	setmetatable(cooldownObject, { __index = Cooldown })

	if callbackFunction then
		delay(cooldownTime, callbackFunction)
	end

	return cooldownObject
end

function Cooldown:hasExpired()
	return self._endTick < tick() and true or false
end

return Cooldown
