print("start")
if (GetUnitName("target") == "Training Dummy") or (GetUnitName("target") == "Raider's Training Dummy") then
print("dummy")
retV=1
else
print("target")
retV=UnitIsEnemy("player","target")
end
print("end")
ps: You can test your script and get lua error in "Tools" > "Development tools", copy your code in text zone and click on buton "Lua (retu...".