I assume the problem is the error 'entity does not exist' because thats the error I get when I run it.
Anyway, to fix this just do a search and replace for 'entity#' and replace with just 'entity'. Entities should just be stored as integers.
Anyway, to fix this just do a search and replace for 'entity#' and replace with just 'entity'. Entities should just be stored as integers.