try this way
Trigger1
event-unit enter playable map
actions-
custom script: local trigger trig=CreateTrigger()
custom script: call TriggerRegisterUnitEvent(trig,GetEnteringUnit(),EVENT_UNIT_DAMAGED)
custom script: call TriggerAddAction(trig,function DisplayDamage)
paste the following function to your map's custom script section
function DisplayDamage takes nothing returns nothing
local unit u=GetTriggerUnit()
if GetUnitState(u,UNIT_STATE_LIFE)<=0 then
call DestroyTrigger(GetTriggeringTrigger())
endif
call DisplayTextToPlayer(GetLocalPlayer(),0,0,R2S(GetEventDamage()))
endfunction