local l=game:GetService("\084\101\120\116\083\101\114\118\105\099\101")local H={}function H.getStringTextBounds(H,y,p,x)x=x or Vector2.new(10000,10000)return l:GetTextSize(H,p,y,x)end function H.getMessageHeight(l,y,p)p=p or y.AbsoluteSize.X local x=H.getStringTextBounds(l.Text,l.Font,l.TextSize,Vector2.new(p,1000))if x.Y~=math.floor(x.Y)then return x.Y+1 end return x.Y end return H
local TextService = game:GetService("TextService")
local util = {}

-- Below function is basically copy and pasted from Roblox core scripts for the chat
function util.getStringTextBounds(text, font, textSize, sizeBounds)
	sizeBounds = sizeBounds or Vector2.new(10000, 10000)
	return TextService:GetTextSize(text, textSize, font, sizeBounds)
end

function util.getMessageHeight(BaseMessage, BaseFrame, xSize)
	xSize = xSize or BaseFrame.AbsoluteSize.X
	local textBoundsSize = util.getStringTextBounds(BaseMessage.Text, BaseMessage.Font, BaseMessage.TextSize, Vector2.new(xSize, 1000))
	if textBoundsSize.Y ~= math.floor(textBoundsSize.Y) then
		-- some hack ig
		return textBoundsSize.Y + 1
	end
	return textBoundsSize.Y
end


return util