Monitor IP delay to alarmthreshold

Why does not this script work?
A test mail works and some other scripts also work.
But this script does not work.
Can someone help me?
Thank you

:local Themes "Monitor IP delay to alarmthreshold" 
#Zet het te monitoren IP address hier onder. 
:local addre 8.8.8.8; 
#Zet de maximale vertraging hier onder in milliseconden. 
:local ms 100; 
:local avgRtt; 
/tool flood-ping $addre count=10 do={ 
:if ($sent = 10) do={ 
:set avgRtt $"avg-rtt" 
}} 
:if ($avgRtt >= $ms) do={ 
#send mail 
/tool e-mail send server=195.130.132.10 port=587user=uwusernaam password=uwpaswoord to=uwemail@gmail.com=uwemail@gmail.com
 subject=$Themes body=("MonitoringIP:$addre\ndelay:$avgRtt ms") 
:log err "Message has been sent"; 
}

Nobody knows a solution.
I am not very familiar with scripts
Someone who can help me?