It work too on AE. Here's the example script I made to test. The function return numbers.
function main()
while not SystemIsReady() do
Wait(0)
end
Wait(3000)
local X, Y, Z = PlayerGetPosXYZ()
local myVeh = VehicleCreateXYZ(math.random(292, 294), X + 3, Y + 3, Z)
X, Y, Z = nil, nil, nil
local showText = false
while true do
Wait(0)
if IsButtonBeingPressed(3, 0) then
showText = not showText
end
if showText then
MinigameSetAnnouncement(tostring(CarGetDamageNumber(myVeh)), true)
--MinigameSetAnnouncement(type(_G.CarGetDamageNumber), true) -- "function"
end
end
end